摘要: Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example 1: Input: 16 Output: true Example 2: Input: 5 Output: 阅读全文
posted @ 2019-08-23 16:14 fatttcat 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of three. Example 1: Example 2: Example 3: Example 4: Follow up:Could you do it witho 阅读全文
posted @ 2019-08-23 15:48 fatttcat 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight). Example 1: Example 2: Exa 阅读全文
posted @ 2019-08-23 15:36 fatttcat 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two. Example 1: Example 2: Example 3: M1: count how many bits are 1s, if # of 1s = 阅读全文
posted @ 2019-08-23 15:29 fatttcat 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your 阅读全文
posted @ 2019-08-23 13:34 fatttcat 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2019-08-23 10:38 fatttcat 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given an array A of positive integers, call a (contiguous, not necessarily distinct) subarray of A good if the number of different integers in that su 阅读全文
posted @ 2019-08-23 08:55 fatttcat 阅读(446) 评论(0) 推荐(0) 编辑
摘要: Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together in any placein the array. Exampl 阅读全文
posted @ 2019-08-23 06:37 fatttcat 阅读(664) 评论(0) 推荐(0) 编辑