Skip to content

Instantly share code, notes, and snippets.

View bashmohandes's full-sized avatar

Mohamed Elsherif bashmohandes

View GitHub Profile
using System;
using System.Linq;
using System.Collections.Generic;
class MainClass
{
public static void Main(string[] args)
{
var p = new SimpleParser();
using System;
using System.Collections.Generic;
public class PyramidSlideDown
{
public static int LongestSlideDown(int[][] pyramid)
{
var cache = new Dictionary<string, int>();
return LongestSlideDownAt(pyramid, 0, 0, cache);
}
using System;
using System.Linq;
using System.Collections.Generic;
public class SumSquaredDivisors
{
public static string listSquared(long m, long n)
{
var result = new List<string>();
for (var i = m; i <= n; i++)
@bashmohandes
bashmohandes / DecodeMorseAdvanced.java
Created January 22, 2017 11:55
Decode the Morse code, advanced
public class MorseCodeDecoder {
public static String decodeBits(String bits) {
System.out.println(bits);
int bitRate = detectBitRate(bits);
System.out.println(bitRate);
int scanner = 0;
while(scanner < bits.length() && bits.charAt(scanner) == '0') scanner++; //skip zeros in front
if(scanner == bits.length()) {
return null;
}