leetcode599】的更多相关文章

Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to help them find out their common interest with the least list index sum. If there is a choice tie betw…
public class Solution { public string[] FindRestaurant(string[] list1, string[] list2) { var dic = new Dictionary<string, int>(); ; i < list1.Length; i++) { ; j < list2.Length; j++) { if (list1[i] == list2[j]) { var restaurant = list1[i]; var…
假设Andy和Doris想在晚餐时选择一家餐厅,并且他们都有一个表示最喜爱餐厅的列表,每个餐厅的名字用字符串表示. 你需要帮助他们用最少的索引和找出他们共同喜爱的餐厅. 如果答案不止一个,则输出所有答案并且不考虑顺序. 你可以假设总是存在一个答案. 示例 1: 输入: ["Shogun", "Tapioca Express", "Burger King", "KFC"] ["Piatti", "T…