{"id":22383817,"url":"https://github.com/jorbush/prueba_tecnica_lambdaclass","last_synced_at":"2025-03-26T20:17:38.081Z","repository":{"id":248249979,"uuid":"805727359","full_name":"jorbush/prueba_tecnica_lambdaclass","owner":"jorbush","description":"Pruebas técnicas realizadas para LambdaClass. [23-05-2023]","archived":false,"fork":false,"pushed_at":"2024-05-25T09:53:21.000Z","size":207,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T02:16:32.693Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jorbush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-25T09:43:56.000Z","updated_at":"2024-07-13T10:34:08.000Z","dependencies_parsed_at":"2024-07-13T12:45:49.197Z","dependency_job_id":"7aede6ac-2635-49bc-992f-b0d640bda50c","html_url":"https://github.com/jorbush/prueba_tecnica_lambdaclass","commit_stats":null,"previous_names":["jorbush/prueba_tecnica_lambdaclass"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorbush%2Fprueba_tecnica_lambdaclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorbush%2Fprueba_tecnica_lambdaclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorbush%2Fprueba_tecnica_lambdaclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorbush%2Fprueba_tecnica_lambdaclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorbush","download_url":"https://codeload.github.com/jorbush/prueba_tecnica_lambdaclass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245727720,"owners_count":20662557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python"],"created_at":"2024-12-05T01:15:26.162Z","updated_at":"2025-03-26T20:17:38.056Z","avatar_url":"https://github.com/jorbush.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prueba técnica Desarrollador Backend de LambdaClass\n\n## Prueba 1\n\n### Enunciado\n\nDada una frase devuelve las palabras al revés.\n\n```\ninput: ”hola como estas”\noutput: “aloh omoc satse”\n```\n\n### Solución\n\n```python\nimport sys\n\n\ndef reverse():\n    phrase = sys.argv[1]\n    print(' '.join(word[::-1] for word in list(phrase.split())))\n\n\ndef reverse_more_efficient():\n    phrase = sys.argv[1]\n    result = \"\"\n    phrase.split()\n    for w in list(phrase.split()):\n        result += reverse_recursive(str(w)) + \" \"\n    print(result)\n\n\ndef reverse_more_efficient_2():\n    phrase = sys.argv[1]\n    result = \"\"\n    phrase.split()\n    result = reverse_list_recursive(phrase.split(), \"\")\n    print(result)\n\n\ndef reverse_list_recursive(phrase, result):\n    if len(phrase) == 0:\n        return result\n    result += reverse_recursive(phrase.pop(0)) + \" \"\n    return reverse_list_recursive(phrase, result)\n\n\ndef reverse_recursive(word):\n    if len(word) == 0:\n        return \"\"\n    return word[len(word) - 1] + reverse_recursive(word[0: len(word) - 1])\n\n\nif __name__ == '__main__':\n    reverse_more_efficient()\n```\n\n### Ejecución\n\n```bash\npython prueba.py \"hola como estas\"\n```\n\n## Prueba 2 - Ransom Note\n\n### Enunciado\n\nRansom Note\n\nA kidnapper plans to write a ransom note by cutting out words\nfrom a newspaper.\nWrite a function that given a note and\na newspaper returns true or false if it is possible to\nwrite the note with the given newspaper.\n(Keep in mind that the words are cut out in full,\nthey are not assembled letter by letter).\n\n### Solución\n\n```python\nimport sys\n\n\ndef can_write_note_by_newspaper():\n    newspaper = sys.argv[1]\n    note = sys.argv[2]\n    can_write = [(word in list(newspaper.split())) for word in note.split()]\n    print(all(can_write))\n\n\ndef can_write_note_by_newspaper_optimized():\n    newspaper = sys.argv[1]\n    note = sys.argv[2]\n    print(can_write_list_recursive(list(newspaper.split()), list(note.split())))\n\n\ndef can_write_list_recursive(newspaper, note):\n    if len(note) == 0:\n        return True\n    new_newspaper = newspaper.copy()\n    note_word = note.pop(0)\n    current_word_result = is_this_word_in_newspaper(new_newspaper, note_word)\n    if current_word_result is False:\n        return False\n    newspaper.remove(note_word)\n    return can_write_list_recursive(newspaper, note)\n\n\ndef is_this_word_in_newspaper(newspaper, note_word):\n    if len(newspaper) == 0:\n        return False\n    if newspaper.pop(0) == note_word:\n        return True\n    return is_this_word_in_newspaper(newspaper,note_word)\n\n\nif __name__ == '__main__':\n    can_write_note_by_newspaper_optimized()\n```\n\n### Ejecución\n\n```bash\npython prueba2.py \"hola como estas\" \"hola estas\"\n```\n\n### Output\n\n![Output](output.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorbush%2Fprueba_tecnica_lambdaclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorbush%2Fprueba_tecnica_lambdaclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorbush%2Fprueba_tecnica_lambdaclass/lists"}