Skip to content

Instantly share code, notes, and snippets.

@Allan-Gong
Created February 11, 2024 18:23
Show Gist options
  • Save Allan-Gong/2570c411e0b9ef1a88c690e04091e2d0 to your computer and use it in GitHub Desktop.
Save Allan-Gong/2570c411e0b9ef1a88c690e04091e2d0 to your computer and use it in GitHub Desktop.
/**
* 2. 給兩個相同長度的integer array, 分別表示從A城市到B城市每天去程和回程的票價.
* 要找出來回票價加總最便宜是多少,規定不能同天來回, 回程要在去程之後.
* 舉例: departure=[10, 8, 9, 11, 7], arrival=[8, 8, 10, 7, 9],
* 那結果是15 (departure[1] + arrival[3] = 8 + 7 = 15)
*/
public class CheapestFlights {
public int cheapeast(int[] from, int[] to) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment