/stockbit-logic-test

Stockbit Logic Test for ReactJS Developer Position

Primary LanguageJavaScriptMIT LicenseMIT

Stockbit Logic Test for ReactJS Developer Position

Author

Problem

Anagram adalah istilah dimana suatu string yang jika dibolak balik ordernya maka akan sama, eg.: 'aku' dan 'kua' adalah Anagram, 'aku' dan 'aka' bukan Anagram.

Dibawah ini ada array berisi sederetan Strings:

['kita', 'atik', 'tika', 'aku', 'kia', 'makan', 'kua']

Silahkan kelompokkan/group kata - kata di dalamnya sesuai dengan kelompok Anagramnya. Catatan: tidak boleh menggunakan syntax es6 map, sort, reduce, find, filter.

Expected Outputs
[
    ["kita", "atik", "tika"],
    ["aku", "kua"],
    ["makan"],
    ["kia"]
]

Solution

  • Language: Javascript

Step by step to run the program

  1. git clone or download the zip file
  2. if you choose to download the zip file, once downloaded, extract the zip
  3. open the program folder with your favorite code editor or you can use terminal without open any code editor
  4. run the program with this command: node index.js
  5. the result will be logged into your terminal
  6. if you want to change the dataset, you can change it inside file data.js