Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
191 views

LeetCode 839: Similar String Groups III

I'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you! Problem Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that ...
Emma Marcier's user avatar
  • 3,712
5 votes
1 answer
99 views

Sorting software version list using Python 2.7 (no modules)

I am participating in a challenge and one of the challenges was to write a script to sort a list of software versions (ex: 1.0, 1.3.2, 12, 1.3.0). Here is the my solution: ...
user40929's user avatar
  • 163
13 votes
1 answer
6k views

Google FooBar "Prepare The Bunnies Escape"

I'm currently working through the google FooBar challenge, and I'm on the third level, in which I have to find the distance between the top left and bottom right points on a grid. The grid is filled ...
Isaac-Neil Zanoria's user avatar
17 votes
2 answers
3k views

Roman to Integer

I'm trying to improve as a programmer and would love any feedback on my code- especially the section in the while loop. How could I make this more readable? What would your opinion as an interviewer ...
DCS's user avatar
  • 395
2 votes
3 answers
2k views

Given a sorted array nums, remove the duplicates in-place

I wrote an algorithm to solve this challenge but would love some feedback on its efficiency and, if you were an interviewer, what your opinion would be on my solution. I believe my time complexity is \...
DCS's user avatar
  • 395
10 votes
1 answer
9k views

Given a string, find the length of the longest substring without repeating characters

I wrote an algorithm that solves this problem but I would love to get some feedback on it (especially since I'm not so confident in my Big \$O\$ skills). Do you think this is a good quality algorithm?...
DCS's user avatar
  • 395
3 votes
2 answers
2k views

Maximum sub-array of non-negative numbers

This is the "Maximum sub-array" problem from CodeChef: Find out the maximum sub-array of non negative numbers from an array. The sub-array should be continuous. That is, a sub-array created ...
Latika Agarwal's user avatar
1 vote
1 answer
1k views

The Substring Game! challenge

This is the Substring Game! challenge from HackerEarth: Watson gives Sherlock a string (let's denote it by S). Watson calculates all the substrings of S in his favourite order. According to the ...
katty's user avatar
  • 615
4 votes
1 answer
1k views

Genomic Range Query in Python

Recently, I worked on one of the Codility Training - Genomic Range Query (please refer to one of the evaluation report for the detail of the task. The solution in Python is based on prefix sum, and ...
sivan shani's user avatar
3 votes
0 answers
394 views

Python2.7 Some xor fun

After doing the Cryptopals challanges, which I found scrolling through codereview, and finally being able to solve set1 challenge 6. I decided to have a little xor fun, and make an automated xor ...
Ludisposed's user avatar
  • 11.8k
2 votes
2 answers
7k views

Finding an increasing sequence from a given array in a time-efficient manner in Python

Problem Statement: Given a sequence of integers as an array, we have to determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the ...
Sreedhar Danturthi's user avatar
3 votes
2 answers
737 views

Merging the frequency rankings of boys' names and girls' names

Problem statement: The html pages for each year which represents the top 1000 most common Girl and Boy names in the order of their frequency are ranked and provided. And they are ranked based on the ...
Sreedhar Danturthi's user avatar
5 votes
1 answer
334 views

AIO programming challenge - Friendlist - Who has the most friends?

I attempted this sample question from the Australia Infomatics Competition. TL;DR - Each line of input contains two numbers, representing a mutual friendship relationship. The output needs to be the ...
John Hon's user avatar
  • 171
13 votes
2 answers
802 views

A classy DNA nucleobase counter

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see Counting nucleobases in a nucleotide c. The repository with all my up-to-date solutions ...
Mast's user avatar
  • 13.8k
5 votes
2 answers
848 views

Zigzag Iterator

I've recently solved the LeetCode's "ZigZag iterator" problem: Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d vectors: ...
alecxe's user avatar
  • 17.5k

15 30 50 per page
1
2 3 4 5
7