首页 > TAG信息列表 > ALength

2020 408 数据结构 算法题

#include<iostream> using namespace std; void solution(int a[], int aLength, int b[], int bLength, int c[], int cLength) { int res[3] = { a[0],b[0],c[0] }; int i = 0, j = 0, k = 0; while (i < aLength && j < bLength &&

常考面试题之两个字符串相加(长整数相加)C#版

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace wsy { class Program { static void Main(string[] args) { string a = Console.ReadLine();

java练习:合并数组、生成随机数

首先准备两个数组,他俩的长度是5-10之间的随机数,并使用随机数初始化这两个数组 然后准备第三个数组,第三个数组的长度是前两个的和 通过System.arraycopy 把前两个数组合并到第三个数组中 import java.util.Random; public class Example3 { public static void main(String[

LeetCode | 67. 二进制求和

给你两个二进制字符串,返回它们的和(用二进制表示)。 输入为 非空 字符串且只包含数字 1 和 0。 示例 1: 输入: a = "11", b = "1" 输出: "100" 示例 2: 输入: a = "1010", b = "1011" 输出: "10101" 提示: 每个字符串仅由字符 '0' 或 '1' 组成。 1 <= a

LeetCode 67

题目 给定两个二进制字符串,返回他们的和(用二进制表示)。 输入为非空字符串且只包含数字 1 和 0。 示例 1: 输入: a = “11”, b = “1” 输出: “100” 示例 2: 输入: a = “1010”, b = “1011” 输出: “10101” 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/ad

160. Intersection of Two Linked Lists

/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } */ public class Solution { public ListNode getIntersection