Skip to content

Instantly share code, notes, and snippets.

@rui-localyze
Last active September 28, 2021 16:10

Revisions

  1. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 1 addition and 16 deletions.
    17 changes: 1 addition & 16 deletions codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -63,19 +63,4 @@ Example 2

    Given the string <code>s = 'I love to code very much'</code>

    The output would be <code> s= 'much very code to love I'</code>

    ### Challenge 5
    Given a string <code>s</code>, you need to reverse the individual words.

    Exemple 1

    Given the string <code>s = 'Hello World'</code>

    The output would be <code> s= 'olleH dlroW'</code>

    Example 2

    Given the string <code>s = 'I love to code very much'</code>

    The output would be <code> s= 'I evol ot edoc yrev hcum'</code>
    The output would be <code> s= 'much very code to love I'</code>
  2. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,32 @@ Given the set
    Constraints
    * `n, m <= 100`

    ### Challenge 4
    Given a string <code>s</code>, you need to reverse the order of the words.

    Exemple 1

    Given the string <code>s = 'Hello World'</code>

    The output would be <code> s= 'World Hello'</code>

    Example 2

    Given the string <code>s = 'I love to code very much'</code>

    The output would be <code> s= 'much very code to love I'</code>

    ### Challenge 5
    Given a string <code>s</code>, you need to reverse the individual words.

    Exemple 1

    Given the string <code>s = 'Hello World'</code>

    The output would be <code> s= 'olleH dlroW'</code>

    Example 2

    Given the string <code>s = 'I love to code very much'</code>

    The output would be <code> s= 'I evol ot edoc yrev hcum'</code>
  3. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,8 @@ Exemple 1
    Given the set
    <code>[1, 2, 3]</code> and the set <code>[3, 4]</code> the output would be <code>[1, 2, 4]</code>

    Constraint
    Constraints
    * `n, m <= 100`



  4. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -40,13 +40,15 @@ Thus, the program must return the position of the first and last element of the
    In this example, the positions 2 and 5, considering the first position with index 0.

    ### Challenge 3
    Given two sets of numbers, find the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) between them.
    Given two arrays of integers (lengths n and m), find the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) between them.

    Exemple 1

    Given the set
    <code>[1, 2, 3]</code> and the set <code>[3, 4]</code> the output would be <code>[1, 2, 4]</code>

    Constraint




  5. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ Given two sets of numbers, find the [symmetric difference](https://en.wikipedia.
    Exemple 1

    Given the set
    <code>[1, 2, 3]</code> and the set <code>[3, 4] </code> the output would be <code>[1, 2, 4]</code>
    <code>[1, 2, 3]</code> and the set <code>[3, 4]</code> the output would be <code>[1, 2, 4]</code>



  6. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -40,11 +40,13 @@ Thus, the program must return the position of the first and last element of the
    In this example, the positions 2 and 5, considering the first position with index 0.

    ### Challenge 3
    Given two sets of numbers, find the symmetric difference between them.
    Given two sets of numbers, find the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) between them.

    Exemple 1

    Given the set <code>[1, 2, 3]</code> and the set <code>[3, 4] </code> the output would be <code>[1, 2, 4]</code>
    Given the set
    <code>[1, 2, 3]</code> and the set <code>[3, 4] </code> the output would be <code>[1, 2, 4]</code>




  7. rui-localyze revised this gist Sep 14, 2021. 1 changed file with 3 additions and 14 deletions.
    17 changes: 3 additions & 14 deletions codechallenge2.md
    Original file line number Diff line number Diff line change
    @@ -40,22 +40,11 @@ Thus, the program must return the position of the first and last element of the
    In this example, the positions 2 and 5, considering the first position with index 0.

    ### Challenge 3
    Given a string `s` consists of some words separated by some number of spaces, return the length of the last word in the string.
    A word is a maximal substring consisting of non-space characters only.

    Example 1
    Given two sets of numbers, find the symmetric difference between them.

    Given the input `s = "Hello World"` the output is 5
    Exemple 1

    Example 2
    Given the set <code>[1, 2, 3]</code> and the set <code>[3, 4] </code> the output would be <code>[1, 2, 4]</code>

    Given the input <code> s = " fly me&#160;&#160;&#160;to&#160;&#160;&#160;the moon&#160;&#160;" </code> the output is 4

    Example 3

    Given the input `s = "luffy is still joyboy"` the output is 6

    Constraints
    * `1 <= s.length <= 104`
    * s consists of only English letters and spaces ' '.
    * There will be at least one word in s.
  8. rui-localyze renamed this gist Sep 14, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. rui-localyze renamed this gist Sep 14, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. rui-localyze created this gist Sep 14, 2021.
    61 changes: 61 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,61 @@
    # Localyze


    ### Coding challenge
    This is our coding challenge, aimed at getting to know you and your code skills a bit better.
    There's no time limit on the challenge, but we expect you to invest just a couple of hours of your day.
    Most of all, we hope you have fun working on this, show off your skills!

    ### What is expected of you?
    Choose at least one of the following challenges and using Ruby or Javascript send us the solution to the challenge, ideally hosted on Github or Gitlab.

    There is no requirement in using a specific framework or tooling, so it’s up to you to use whatever you find yourself comfortable with. Tests are welcome too.

    Please remember to add some documentation explaining how to use your solution.


    ### Challenge 1
    Given a word, write an algorithm that returns the sequence of a specific character that appears the most in sequence. If there are many of them, return the first character.

    Examples

    Given the input `"Pressuuuuuure"` the output is `"uuuuuu"`

    Given the input `"Boat"` the output is `"B"`

    Given the input <code>"A hot&#160;&#160;dog"</code> the output is <code>"&#160;&#160;"</code> (2 spaces!)

    ### Challenge 2
    Given a set of numbers, find the subset in which the sum of the elements is the maximum sum.

    Example

    Given the set of elements
    `[2, -4, 6, 8, -10, 100, -6, 5]`

    The maximum sum subset is:
    `[2, -4,`**`6, 8, -10, 100`**`, -6, 5]`

    Thus, the program must return the position of the first and last element of the subset.
    In this example, the positions 2 and 5, considering the first position with index 0.

    ### Challenge 3
    Given a string `s` consists of some words separated by some number of spaces, return the length of the last word in the string.
    A word is a maximal substring consisting of non-space characters only.

    Example 1

    Given the input `s = "Hello World"` the output is 5

    Example 2

    Given the input <code> s = " fly me&#160;&#160;&#160;to&#160;&#160;&#160;the moon&#160;&#160;" </code> the output is 4

    Example 3

    Given the input `s = "luffy is still joyboy"` the output is 6

    Constraints
    * `1 <= s.length <= 104`
    * s consists of only English letters and spaces ' '.
    * There will be at least one word in s.