Skip to content

Instantly share code, notes, and snippets.

View bangarharshit's full-sized avatar

Harshit Bangar bangarharshit

  • Twitter
View GitHub Profile
public class BalancedParanthesis2 {
public static void main(String[] args) {
}
// ((()))
private static boolean validExpression(String expression, int numOfRetriesAvailable) {
if (expression == null) {
return true;
}
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 {
import UIKit
// Runnable -> no input, no output
// Callable -> no input -> Producer
// Function -> input, output
// Consumer
// **Higher order function**