Skip to content

Instantly share code, notes, and snippets.

View AmnesiacSloth's full-sized avatar

Christian Velasquez AmnesiacSloth

  • San Diego, CA
View GitHub Profile

Two Sum 📗

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

Valid Anagram 📗

Given two strings s and t, return true if the two strings are anagrams of each other, otherwise return false.

An anagram is a string that contains the exact same characters as another string, but the order of the characters can be different.

Example 1:

Duplicate Integer 📗

Given an integer array nums, return true if any value appears more than once in the array, otherwise return false.

Example 1

Input: nums = [1, 2, 3, 3]

Output: true