2017-3-10 leetcode 229 238 268】的更多相关文章

今天登陆leetcode突然发现531被锁了,有种占了便宜的感觉哈哈哈! ================================================ leetcode229 Majority Element II leetcode238 Product of Array Except Self leetcode268 Missing Number ================================================ 229讲的是给你n个数字,找出…
2017/11/6 Leetcode 日记 344. Reverse String Write a function that takes a string as input and returns the string reversed. class Solution { public: string reverseString(string s) { , sz = s.size()-; ; i < sz; i++, sz--){ char temp = s[i]; s[i] = s[sz];…
挑战全年最低价!MyEclipse线上狂欢仅剩最后3天!立即抢购>> 2017 CI 10主要是一个错误修复版本,这个版本为Angular和TypeScript工具提供了重要的修复,并为Inline Search增加了一些可用性修复.同时修复了一些用户在macOS High Sierra上遇到的严重崩溃问题. [MyEclipse 2017 CI 10安装包下载] Angular & TypeScript 在内容辅助功能上做出了一些修正——缺少类型的错误,同时修复区分大小写和排序的问题…
2017/11/22 Leetcode 日记 136. Single Number Given an array of integers, every element appears twice except for one. Find that single one. class Solution { public: int singleNumber(vector<int>& nums) { int len = nums.size(); ]; ; i < len; i++){…
2017/11/21 Leetcode 日记 496. Next Greater Element I You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.…
2017/11/13 Leetcode 日记 463. Island Perimeter You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surro…
2017/11/14 Leetcode 日记 442. Find All Duplicates in an Array Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could you do it withou…
2017/11/9 Leetcode 日记 566. Reshape the Matrix In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. You're given a matrix represented by a two-dimensiona…
2017/11/7 Leetcode 日记 669. Trim a Binary Search Tree Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the re…
2017/11/5 Leetcode 日记 476. Number Complement Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of a 32-bit s…