Skip to content

Instantly share code, notes, and snippets.

View brachi-wernick's full-sized avatar

Brachi Packter brachi-wernick

  • moonactive
  • Israel
View GitHub Profile
@y0n1
y0n1 / Solution.java
Last active March 24, 2024 13:31
Given a string of an arithmetic expression; which includes only two operators: '+', '*' , write a function that evaluates the expression and returns its result.Input: A (possible) very long string of an arithmetic expression: "1*2*3+1+20".Output: 27
public class Solution {
public static void main(String[] args) {
String[] input = { "5", "4+20*3", "20*3+4", "20+20+20+4", "4*4*4" };
for (String test : input)
System.out.printf("%s = %d%n", test, eval(test));
}
private static int eval(String input) {
int sum = 0;
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active September 27, 2024 16:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k