FB两轮店面面筋附面筋整理

10/29 第一轮 印度小哥哥
利口二流
利口时
都是原题没有变化

11/8 第二轮,人超好的国人小哥
利口三霸气
wood cut

攒rp希望能过
也祝各位加油加油

这个链接是自己整理的一些面筋题,供大家食用

lz太棒啦,加油!对了,问下一二面都有bq吗

两天前面的现在还木有信,楼主有信了update一下呗

楼主好运!!!希望能拿到offer!!

我也是两天前面的 现在也木有信。。。

求问wood cut 是什么?

	/**
	 * Wood Cut Given n pieces of wood with length L[i] (integer array). Cut
	 * them into small pieces to guarantee you could have equal or more than k
	 * pieces with the same length. What is the longest length you can get from
	 * the n pieces of wood? Given L & k, return the maximum length of the small
	 * pieces. Priorities: 1. Have to get calculatedK >= givenK 2. Meanwhile,
	 * want to maximize the small piece. One thing not clear: do we have to use
	 * the given small piece? If we have to, we need to concern about the
	 * shortest wood piece. See commentted-out part In this problem, however, we
	 * can abandon the small pieces, as long as the max_small_pieces can allow
	 * calculatedK >= givenK. Use binary search on the largest item: 1. if
	 * calculatedK < givenK: end = mid; 2. If calculated >= givenK, move start =
	 * mid as much as possible, which gives maximized small piece.

start = 0, end = 5, wrong 4
L [5], k = 1
	 */
	public int woodCut(int[] L, int k) {
		int end = 0;

		for (int len : L) {
			end = Math.max(end, len);
		}

		if (numWood(end, L) >= k) {
			return end;
		}

		// trying to cut with length 1 - max
		int start = 0;
		while (start + 1 < end) {
			int mid = start + ((end - start) >>> 1);
			int numMid = numWood(mid, L);
			if (numMid >= k) {
				start = mid;
			} else {
				end = mid;
			}
		}

		return start;
	}

	private int numWood(int length, int[] L) {
		int count = 0;
		for (int len : L) {
			count += len / length;
		}
		return count;
	}

一面没有啥BQ,稍微聊了一下就做题了。
二面聊了挺多的。大概可能有15-20min左右的样子。做了一下自我介绍,让后让我介绍简历上最有趣的项目,最难的项目。。etc

请问一般多长时间会有update呢?

感谢!希望了。。也祝你有offer!

就是:
有n个woods,arr表示了各个的长度。要求切这些木头,
使得切除>=k的pieces,这些pieces有相同的长度len。maximize the len。

woods: (5, 9, 7), k = 3; return 5; (5->5; 9->5+4; 7->5+2)
woods: (5, 9, 7), k = 4; return 4; (5->4+1; 9->4*2+1; 7->4+3)