📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
12
返回列表 发新帖
楼主: ohyline
跳转到指定楼层
上一主题 下一主题
收起左侧

Facebook电面两轮

🔗
eko910817 2016-2-17 09:21:45 | 只看该作者
全局:
请问Lz是因为phd所以要match吗?还是所有intern都要match上才有offer?
回复

使用道具 举报

🔗
iwofr 2016-2-18 08:49:21 | 只看该作者
全局:
ohyline 发表于 2016-2-16 12:42
可能一面不好 加面了3面 已进pool一周多。。。在match

FB不是都直接发offer吗为啥会match呢。。
回复

使用道具 举报

🔗
iwofr 2016-2-18 09:02:50 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
wtcupup 2016-2-28 14:28:54 | 只看该作者
全局:
第一面第二题那个2d matrix其实lintcode上有类似的 http://www.lintcode.com/en/problem/submatrix-sum/#
回复

使用道具 举报

🔗
sjph 2016-8-2 19:44:51 | 只看该作者
全局:
第一面第二题的2d matrix,大家谁有code可以分享一下吗,刚才试着实现,还是问题不断。。。多谢了!
回复

使用道具 举报

🔗
ShutingChen 2016-8-8 03:20:45 | 只看该作者
全局:
心理住着是码农真是极坏了。。。
回复

使用道具 举报

🔗
jiya 2016-9-4 07:44:21 | 只看该作者
全局:
  1. public class Solution {
  2.     /**
  3.      * @param matrix an integer matrix
  4.      * [url=home.php?mod=space&uid=160137]@return[/url] the coordinate of the left-up and right-down number
  5.      */
  6.     public int[][] submatrixSum(int[][] matrix) {
  7.         int[][] res = new int[][] {{0, 0}, {0, 0}};
  8.         if (matrix != null && matrix.length > 0) {
  9.             for (int i = 0; i < matrix.length; i++) {
  10.                 for (int j = 0; j < matrix[0].length; j++) {
  11.                     matrix[i][j] += (i - 1 >= 0 ? matrix[i - 1][j] : 0) + (j - 1 >= 0 ? matrix[i][j - 1] : 0) - (i - 1 >= 0 && j - 1 >= 0 ? matrix[i - 1][j - 1] : 0);
  12.                 }
  13.             }
  14.             for (int i = 0; i < matrix.length; i++) {
  15.                 for (int j = i; j < matrix.length; j++) {
  16.                     Map<Integer, Integer> map = new HashMap<Integer, Integer>();
  17.                     int sum = 0;
  18.                     map.put(0, -1);
  19.                     for (int k = 0; k < matrix[0].length; k++) {
  20.                         sum = getSum(matrix, i, 0, j, k);
  21.                         if (map.containsKey(sum)) {
  22.                             res = new int[][] {{i, map.get(sum) + 1}, {j, k}};
  23.                             return res;
  24.                         } else {
  25.                             map.put(sum, k);
  26.                         }
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.         return res;
  32.     }
  33.     private int getSum(int[][] matrix, int x1, int y1, int x2, int y2) {
  34.         return matrix[x2][y2] - (x1 - 1 >= 0 ? matrix[x1 - 1][y2] : 0) - (y1 - 1 >= 0 ? matrix[x2][y1 - 1] : 0) + (x1 - 1 >= 0 && y1 - 1 >= 0 ? matrix[x1 - 1][y1 - 1] : 0);
  35.     }
  36. }
复制代码


Accepted code for http://www.lintcode.com/en/problem/submatrix-sum/# on Lintcode
回复

使用道具 举报

🔗
jiya 2016-9-4 07:45:05 | 只看该作者
全局:
jiya 发表于 2016-9-4 07:44
Accepted code for http://www.lintcode.com/en/problem/submatrix-sum/# on Lintcode

时间复杂度:O(n^3)
回复

使用道具 举报

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

本版积分规则

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