Skip to content

Instantly share code, notes, and snippets.

@inspector-ambitious
Last active April 26, 2022 15:20
Show Gist options
  • Select an option

  • Save inspector-ambitious/a9b310e303433bc84c4d5933fe6f91d5 to your computer and use it in GitHub Desktop.

Select an option

Save inspector-ambitious/a9b310e303433bc84c4d5933fe6f91d5 to your computer and use it in GitHub Desktop.

Exercise 1

Write a method that compute the sum of all the elements of an array of integers.

Example

input: [1, 2, 2, 3, 3, 4, 5, 6, 5, 7, 7, 7, 8, 8, 1] output: 69

Template

public static class SumNumbers
{
    public static int Sum(int[] input)
    {
    }
}

Exercise 2

Write a the method to reverse a string.

Example

input: "abcde" output: "edcba"

Template

public static class ReverseString
{
    public static string Reverse(string input)
    {
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment