原文:LeetCode Add Binary

Given two binary strings, return their sum also a binary string . For example,a b Return . 这题用数组来做可能更简单,但考虑到可能面试的时候要求不能开额外的数组,就只能对string操作了。最主要的是把进位这部分写对。 ...

2012-10-27 19:23 0 4023 推荐指数:

查看详情

[leetcode]Add Binary @ Python

原题地址:https://oj.leetcode.com/problems/add-binary/ 题意: Given two binary strings, return their sum (also a binary string). For example,a = "11"b ...

Sun Jun 08 19:45:00 CST 2014 2 3623
Add Binary Leetcode java

题目: Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 题解: 二进制加法都是从最低位(从右加到左)。所以对 ...

Mon Aug 04 13:07:00 CST 2014 2 4683
LeetCode】67. Add Binary

Add Binary Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 先进行对齐操作,然后从右往左逐位相加,注意进位 ...

Wed Dec 10 19:29:00 CST 2014 0 2187
[LeetCode] 67. Add Binary 二进制数相加

Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. ...

Wed Feb 28 10:38:00 CST 2018 2 1272
[LeetCode] Add Binary 二进制数相加

Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 二进制数相加,并且保存在string中,要注意的是如何将string ...

Sun Nov 09 20:59:00 CST 2014 4 14188
[Leetcode] Balanced Binary Tree

问题:给一个二叉树,写一个算法判断这个树是不是balanced。 Solution #1. 第一次遇到这个问题时我的解法,如下: 写了一个getDepth()函数,访问每个节点都要调用一次这个函数。这个Solution也通过了leetcode的验证程序,但是后来想了想,I ...

Sun May 04 08:58:00 CST 2014 2 6363
LeetCode Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which ...

Sun Oct 28 06:40:00 CST 2012 5 4228
[LeetCode] Validate Binary Search Tree

Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node ...

Fri Nov 16 17:23:00 CST 2012 2 4267
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM