This folder contains a series of coding problems that I have practiced on leetcode type websites or during technical assessments that I wanted to review after the fact. They are listed below with a brief description.
Given 2 logs across 2 separate days return the unique duplicate UserId & DocId combinations. The logs are formatted in the following way with no headers.
DateTime,UserId,DocId\n
Added formatting for readability.
You are provided with a list of healthcare claim records in JSON format. Each record contains the following fields:
claim_id (string)
patient_id (string)
provider_id (string)
claim_amount (float)
claim_date (string in 'YYYY-MM-DD' format)
status (string: 'approved', 'denied', or 'pending')
Your task is to write a Python function that processes this list and returns a summary report as a dictionary with the following information:
Total number of claims
Total approved claim amount
Number of unique patients
Number of claims per status
Average claim amount per provider
Given an integer n, return a string array answer (1-indexed) where:
answer[i] == "FizzBuzz" if i is divisible by 3 and 5.k = 4
answer[i] == "Fizz" if i is divisible by 3.k = 4
answer[i] == "Buzz" if i is divisible by 5.k = 4
answer[i] == i (as a string) if none of the above conditions are true.k = 4
Given an array of integers and an integer k, return the maximum sum of any continuous subarray of size k.
Example:
Input: nums = [1, 4, 2, 10, 23, 3, 1, 0, 20], k = 4
Output: 39 (because 10 + 23 + 3 + 1 = 37 is highest of any window of size 4)
Given a string s, find the length of the longest substring without repeating characters
ex.
Input: s = "abcabcbb"
Output: 3
Design a data structure that supports insert, delete, search, and getRandom in constant time.
Create a Queue (FIFO) using 2 stacks (LIFO)
Given a list of integers, return all possible subsets (the power set).
Create a book object. This object should contain the Title, author, and genre. Create a title lookup, author lookup, and binary search for titles.
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string "".
Example 1:
Input: strs = ["flower","flow","flight"]
Output: "fl"
Example 2:
Input: strs = ["dog","racecar","car"]
Output: ""
Explanation: There is no common prefix among the input strings.
Given an integer x, return true if x is a palindrome, and false otherwise. A palindrome is an int that reads the same forward and backward.
Constraints:
-2^31 <= x <= 2^31 - 1
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.
Constraints:
2 <= nums.length <= 10^4
-10^9 <= nums[i] <= 10^9
-10^9 <= target <= 10^9
Only one valid answer exists.
Create a simple linked list that contains a value and is aware of the next node in the list.
Have the function BracketCombinations(num) read num which will be an integer greater than or equal to zero, and return the number of valid combinations that can be formed with num pairs of parentheses. For example, if the input is 3, then the possible combinations of 3 pairs of parenthesis, namely: ()()(), are ()()(), ()(()), (())(), ((())), and (()()). There are 5 total combinations when the input is 3, so your program should return 5.
Make the counter increase every time the button is pressed in JS
Have the function BasicRomanNumerals(str) read str which will be a string of Roman numerals. The numerals being used are: I for 1, V for 5, X for 10, L for 50, C for 100, D for 500 and M for 1000. In Roman numerals, to create a number like 11 you simply add a 1 after the 10, so you get XI. But to create a number like 19, you use the subtraction notation which is to add an I before an X or V (or add an X before an L or C). So 19 in Roman numerals is XIX. The goal of your program is to return the decimal equivalent of the Roman numeral given. For example: if str is "XXIV" your program should return 24
Have the function ApproachingFibonacci(arr) take the arr parameter being passed which will be an array of integers and determine the smallest positive integer including zero that can be added to the array to make the sum of all of the numbers in the array add up to the next closest fibonacci number
Access a public S3 Bucket and print all filenames that start with "__cb__"