Cpp
sight23455
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
An algorithm to calculate the greater 2^n close to num.
ifnum&(num-1)!=0{ fornum&(num-1)!=0{ num&=(num-1) } num=num<<1 }原创 2019-11-21 11:45:03 · 107 阅读 · 0 评论 -
my raw answers for leetcode - 9. Palindrome Number
Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanat...原创 2019-11-20 11:46:34 · 117 阅读 · 0 评论 -
my raw answers for leetcode - 8. String to Integer (atoi)
Implement atoi whichconverts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from thi...原创 2019-11-19 18:25:15 · 107 阅读 · 0 评论 -
my raw answers for leetcode - 7. Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 code: classSolution{ pub...原创 2019-11-13 18:24:03 · 151 阅读 · 0 评论 -
leetcode 11/10/19 周赛记录。
第一题: 1252. Cells with Odd Values in a Matrix Givennandmwhich are the dimensions of a matrix initialized by zeros and given an array indiceswhere indices[i] = [ri, ci]. For each pair of [ri, ci]...原创 2019-11-12 11:40:16 · 164 阅读 · 0 评论 -
my raw answers for leetcode - 6. ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) And then read line by lin...原创 2019-11-08 15:08:42 · 140 阅读 · 0 评论 -
leetcode 11/02/19, 11/03/19 周赛记录。
第一次参加周赛就单双周一起报了。刷的题还不多,因此每场只记录2-3道自己掌握的(比赛时提交通过或完了通不过,事后看一眼就明白怎么回事的)。Cuz my current goal is to get completely control of questions which are easy or medium-hard to solve(The label "hard" marked by Lee...原创 2019-11-04 11:10:04 · 386 阅读 · 0 评论 -
my raw answers for leetcode - 5. Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Exampl...原创 2019-10-18 17:27:55 · 149 阅读 · 0 评论 -
My first implementation of Cpp for Binary Search Tree.
After gettingthrough of some video lessons about such Binary Tree, Binary Search Tree, I get comprehend of this kind of algorithm method and would like to do a brief implementation. Following is my C...原创 2019-10-15 15:08:35 · 118 阅读 · 0 评论
分享