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

刷题记录帖

🔗
 楼主| Oceanid77 2019-9-29 12:13:44 | 只看该作者
全局:
public Object getOrDefault(Object key, Object defaultValue)
Parameters: This method accepts two parameter:

key: whose mapping is to be checked in this Properties object.
defaultValue: which is the default mapping of the key
Returns: This method returns the value fetched corresponding to this key, if present. If there is no such mapping, then it returns the defaultValue.

266. Palindrome Permutation
How to optimize the code.
怎样做code 优化
check if you can change two pass to a single pass.
on the fly.
Approach #4 Single Pass

dealling with odd or even number of occurence: use set.
practice tmr

49. Group Anagrams
use hashmap to get different size of arrays output practice

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

not finish
finish two ontest.

Need to study more tmr
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-1 00:57:07 | 只看该作者
全局:
463. Island Perimeter

290. Word Pattern
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-1 12:51:35 | 只看该作者
全局:
204. Count Primes
practice tmr

30. Substring with Concatenation of All Words
290. Word Pattern
205. Isomorphic Strings
index.put(pattern.charAt(i), i) != index.put(words[i], i) why?

mapc.containsKey(tmpc) ^ mapstr.containsKey(tmpstr)
what does this mean?


!=
Objects.equals(Object a, Object b)
Object.equals(Object o)

// java.util.Objects
public static boolean equals(Object a, Object b) {
     return (a == b) || (a != null && a.equals(b));
}

// java.lang.Object
public boolean equals(Object obj) {
    return (this == obj);
}
246. Strobogrammatic Number
two pointer
try use hashmap tmr

247. Strobogrammatic Number II
recuisive iterative not start yet.
22. Generate Parentheses



补充内容 (2019-10-10 11:33):
public V put(K key,
             V value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
Specified by:
put in interface Map<K,V>
Overrides:
put in class AbstractMap<K,V>
Parameters:
key - key with which the specified value is to be associated
value - value to be associated with the specified key
Returns:
the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-3 01:14:10 | 只看该作者
全局:
204. Count Primes
study more for fasterer solution'

290. Word Pattern
??I have question here, Why my code cannot go through.

205. Isomorphic Strings
done study for more fast solution

30. Substring with Concatenation of All Words
understand try tmr

246. Strobogrammatic Number
understand hashmap
247. Strobogrammatic Number II
understand recursive
389. Find the Difference
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-3 13:28:58 | 只看该作者
全局:
409. Longest Palindrome
done.
int [] count = new int[128];
128  these include the digits 0 to 9, lowercase letters a to z, uppercase letters A to Z, and punctuation symbols.
for (int v: count) {
     ans += v / 2 * 2;
     if (ans % 2 == 0 && v % 2 == 1)//this one is nice
     ans++;
        }

Greedy , what is that?
359. Logger Rate Limiter

design
347. Top K Frequent Elements

Heap

30. Substring with Concatenation of All Words
finish one way, need to study faster way


76. Minimum Window Substring

Sliding window

209. Minimum Size Subarray Sum
NOT DONE YET
567. Permutation in String
239. Sliding Window Maximum
632. Smallest Range Covering Elements from K Lists
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-5 01:12:55 | 只看该作者
全局:
347. Top K Frequent Elements
finish, need to study more fast way.
192. Word Frequency
215. Kth Largest Element in an Array
finish with one method. Study more about some other method,
451. Sort Characters By Frequency
659. Split Array into Consecutive Subsequences
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-5 10:21:35 | 只看该作者
全局:
347. Top K Frequent Elements
Bucket sort, practice tommorrow. Good idea.
Question here: How does this code manage the sequence?

Tree Set
692. Top K Frequent Words
similar to 347
half done: question: how to make sure the out put sequence?
Tree Set
451. Sort Characters By Frequency
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-7 01:49:12 | 只看该作者
本楼:
全局:
周六休息
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-7 12:09:15 | 只看该作者
全局:
692. Top K Frequent Words
compareto ???
347. Top K Frequent Elements

266. Palindrome Permutation
Approach 4.
deal with odd and even occurence.
similar question.

A set of questions:
Backtracking
267. Palindrome Permutation II
31. Next Permutation
47. Permutations II

Group series:
49. Group Anagrams
question here: return ans.values();
return ArrayList(ans.values());
why?
249. Group Shifted Strings

contest
1217. Play with Chips
1218. Longest Arithmetic Subsequence of Given Difference

Subsequence
回复

使用道具 举报

🔗
 楼主| Oceanid77 2019-10-8 01:48:40 | 只看该作者
全局:
692. Top K Frequent Words
compareto ???
347. Top K Frequent Elements

266. Palindrome Permutation
Approach 4.
deal with odd and even occurence.
similar question.

A set of questions:
Backtracking
267. Palindrome Permutation II
31. Next Permutation
47. Permutations II

Group series:
49. Group Anagrams
question here: return ans.values();
return ArrayList(ans.values());
why?
249. Group Shifted Strings

contest
1217. Play with Chips
1218. Longest Arithmetic Subsequence of Given Difference

Subsequence
回复

使用道具 举报

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

本版积分规则

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