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

Leetcode 刷题记录!!!不信自己今年找不到工作!!!

 
🔗
prisoner33 2015-9-6 17:37:38 | 只看该作者
全局:
楼主开始找工作了吗?还是已经找到了?
加油!
回复

使用道具 举报

🔗
 楼主| love1point 2015-9-7 04:59:25 | 只看该作者
全局:
prisoner33 发表于 2015-9-6 17:37
楼主开始找工作了吗?还是已经找到了?
加油!

刚开学没多久,还在继续找啊
回复

使用道具 举报

🔗
antowa 2015-9-15 23:06:42 | 只看该作者
全局:
能坚持下去很不容易了。加油!
回复

使用道具 举报

🔗
tyxherbert 2015-10-13 10:05:34 | 只看该作者
全局:
good luck! 加油
回复

使用道具 举报

🔗
 楼主| love1point 2015-10-14 12:25:43 | 只看该作者
全局:
// Long time no update in here. Recent busy with course projects. Back to leetcode again. Just heard that this year will be more difficult to find a job? Let's see together, but we still need to move forward daily!!!

Nim Game

Link: https://leetcode.com/problems/nim-game/
  1. public class Solution {
  2.     public boolean canWinNim(int n) {
  3.         if(n % 4 == 0)
  4.         {
  5.             return false;
  6.         }
  7.         else
  8.         {
  9.             return true;
  10.         }
  11.     }
  12. }
复制代码
回复

使用道具 举报

🔗
 楼主| love1point 2015-10-14 12:57:09 | 只看该作者
全局:
// After some time not doing leetcode, one highlight improvement is that they add the custom test case function. Good to see this new feature.

Word Pattern

Link: https://leetcode.com/problems/word-pattern/
  1. public class Solution {
  2.     public boolean wordPattern(String pattern, String str) {
  3.         String[] newStr = str.split(" ");
  4.         if(pattern.length() != newStr.length)
  5.         {
  6.             return false;
  7.         }
  8.         HashMap<Character, String> map = new HashMap<Character, String>();
  9.         for(int i = 0; i < pattern.length(); i++)
  10.         {
  11.             if(map.containsKey(pattern.charAt(i)))
  12.             {
  13.                 if(!map.get(pattern.charAt(i)).equals(newStr[i]))
  14.                 {
  15.                     return false;
  16.                 }
  17.             }
  18.             else
  19.             {
  20.                 if(map.containsValue(newStr[i]))
  21.                 {
  22.                     return false;
  23.                 }
  24.                 map.put(pattern.charAt(i), newStr[i]);
  25.             }
  26.         }
  27.         return true;
  28.     }
  29. }
复制代码
回复

使用道具 举报

🔗
 楼主| love1point 2015-10-15 11:00:34 | 只看该作者
全局:
// Wish when this post is being view 10000 times, I can get a job offer.

First Bad Version:

https://leetcode.com/problems/first-bad-version/
  1. /* The isBadVersion API is defined in the parent class VersionControl.
  2.       boolean isBadVersion(int version); */

  3. public class Solution extends VersionControl {
  4.     public int firstBadVersion(int n) {
  5.         if(n == 1)
  6.         {
  7.             return 1;
  8.         }
  9.         
  10.         int left = 1;
  11.         int right = n;
  12.         
  13.         while(left < right)
  14.         {
  15.             int mid = left + (right - left) / 2;
  16.             if(isBadVersion(mid))
  17.             {
  18.                 right = mid;
  19.             }
  20.             else
  21.             {
  22.                 left = mid + 1;
  23.             }
  24.         }
  25.         return right;
  26.     }
  27. }
复制代码
回复

使用道具 举报

🔗
newnew 2016-7-21 06:44:56 | 只看该作者
全局:
楼主是上课的时候一天刷十道题吗
回复

使用道具 举报

🔗
 楼主| love1point 2017-3-2 12:23:22 | 只看该作者
全局:
chenling1994122 发表于 2017-2-9 21:23
你好,我刚刚准备开始刷leetcode, 我之前是自动化专业,所以编程基础比较差,完全不知如何下手, 求大神指 ...

我觉得直接上手leetcode就行了,从AC率最高的刷起
回复

使用道具 举报

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

本版积分规则

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