This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BalancedParanthesis2 { | |
public static void main(String[] args) { | |
} | |
// ((())) | |
private static boolean validExpression(String expression, int numOfRetriesAvailable) { | |
if (expression == null) { | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.List; | |
// Uber $ - 5 3 4 6 7 8 9 9 7 6 5 8 | |
// Any day - You can buy 1 stock or you can sell all your stocks or do nothing. | |
// You have to maximize your profit. | |
// (9-5) + (9-3) + (9-4) + (9-6) + (9-7) + (8-7) + (8-6) + (8-5) | |
// 8, 5, 6, 7, 9, 9, 8 | |
// max = 9 | |
public class StockBuySell { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Runnable -> no input, no output | |
// Callable -> no input -> Producer | |
// Function -> input, output | |
// Consumer | |
// **Higher order function** |
OlderNewer