Skip to content

Instantly share code, notes, and snippets.

View aksnell's full-sized avatar
🏠
Working from home

Alex Snell aksnell

🏠
Working from home
  • Walmart Global Tech
  • Bentonville, Arkansas
  • 17:17 (UTC -12:00)
View GitHub Profile
using System.Linq;
namespace Solution
{
public static class Program
{
public static int findSum(int n)
{
return Enumerable.Range(1, n).Where(x => x % 5 == 0 || x % 3 == 0).Sum();
}
}
using System;
using System.Linq;
public class Kata
{
public static string AbbrevName(string name)
{
return name.ToUpper().Split(" ").Aggregate((first, last) => first[0] + "." + last[0]);
}
}
using System;
using System.Linq;
public static class Kata
{
public static int DescendingOrder(int num)
{
return int.Parse(string.Join("", num.ToString().OrderByDescending(x => x)));
}
}
using System;
using System.Collections.Generic;
public class DnaStrand
{
public static string MakeComplement(string dna)
{
List<char> compliment = new List<char>();
foreach (var nucleo in dna)
func hasForwardMatch(target string, index int) bool {
matchStack := 1
for i := index + 1; i < len(target); i++ {
if target[i] == '(' {
matchStack++
} else {
matchStack--
if matchStack == 0 {
return true
}
package kata
func ValidParentheses(parens string) bool {
pStack := 0
for _, paren := range parens {
if paren == '(' {
pStack++
} else {
if pStack == 0 {
return false