楼主: Oceanid77
跳转到指定楼层
上一主题 下一主题
收起左侧

刷题记录帖

🔗
 楼主| Oceanid77 2019-9-19 13:59:17 | 只看该作者
全局:
本帖最后由 Oceanid77 于 2019-9-19 14:02 编辑

937. Reorder Data in Log Files
use comparator. practice.


125. Valid Palindrome
finish two pointers technique

learn to finish alphanumeric technique.


157. Read N Characters Given Read4
API?


回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-20 11:55:43 | 只看该作者
全局:
415. Add Strings
finish this .
compare reading about adding
58. Length of Last Word
   if(s==" "){return 0;}
  if(arr==null){return 0;}
when you want to say there is nothing in it.

43. Multiply Strings
use graph

use AC solution.
finish
231. Power of Two
done
while(n%2==0){
            n=n/2;
        }
Bitwise Operators : not understand

326. Power of Three
need to understand more ways.

342. Power of Four
need to understand more ways.
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-23 04:21:38 | 只看该作者
全局:
周五
6. ZigZag Conversion
studied first approach
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-23 04:21:52 | 只看该作者
全局:
周六休假一天
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-23 12:12:44 | 只看该作者
全局:
22. Generate Parentheses

not done , hard to understand

937. Reorder Data in Log Files
Public String [ ] split ( String regex, int limit )
limit > 0 : If this is the case then the pattern will be applied at most limit-1 times, the resulting  array’s length will not be more than n, and the resulting array’s last entry will contain all input beyond the last matched pattern.
limit < 0 : In this case, the pattern will be applied as many times as possible, and the resulting array can be of any size.
limit = 0 : In this case, the pattern will be applied as many times as possible, the resulting array can be of any size, and trailing empty strings will be discarded.


comparater:
class IntComparator<T> implements Comparator<T> {
    public int compare(T a, T b) {
        int num1 = (Integer)a;
        int num2 = (Integer)b;
        
        if(num1 > num2) { //如果 a>b,根据自定义规则 a 应该在前面,即自定义规则中 a “小于” b,故此时返回负值
            return -1;
        } else if(num1 < num2) {
            return 1;
        } else {
            return 0;
        }
    }
}
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-24 11:54:41 | 只看该作者
全局:
Studied backtracking. Need to find resource to help me understand it.
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-25 12:20:14 | 只看该作者
全局:
136. Single Number
boolean containsKey(Object key): Used to return True if for a specified key, mapping is present in the map.
boolean containsValue(Object value): Used to return true if one or more key is mapped to a specified value.
boolean isEmpty(): Used to check whether the map is empty or not. Returns true if the map is empty.
Object get(Object key): It is used to retrieve or fetch the value mapped by a particular key.
int size(): It is used to return the size of a map.
Object put(Object key, Object value): It is used to insert a particular mapping of key-value pair into a map.

hashset
boolean add(E e): Used to add the specified element if it is not present, if it is present then return false.
boolean contains(Object o): Used to return true if an element is present in set.
boolean isEmpty(): Used to check whether the set is empty or not. Returns true for empty and false for non-empty condition for set.
int size(): Used to return the size of the set.

相对应的ti

202. Happy Number
studied one method. Not finish
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-26 11:28:28 | 只看该作者
全局:
260. Single Number III
Approach 2: Two bitmasks not finish

202. Happy Number

finish one way, continuew with some other way. think reversly.

And understand the resursive way.

349. Intersection of Two Arrays
not finish yet
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-28 01:16:30 | 只看该作者
全局:
周四面试zoox 累瘫
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-9-28 15:01:43 | 只看该作者
全局:
242. Valid Anagram
use two set to compare。 not right. Why?
need to study more

Arrays.equals() : check whether two arrays are equal or not
char[] str1 = s.toCharArray();

Practice tmr.
  for(int i = 0; i < s.length(); i++){
            sMap.put(s.charAt(i), sMap.getOrDefault(s.charAt(i), 0) + 1);
        }

349. Intersection of Two Arrays
use two set to compare.
Arrays copyOf()
copyOf(int[] original, int newLength)

set1.retainAll(set2);

266. Palindrome Permutation

finish one method, study more.

49. Group Anagrams
notfinish yet

438. Find All Anagrams in a String
check sliding winfdow.

补充内容 (2019-10-8 02:19):
49. Group Anagrams finish
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表