# programming-challenge's questions - English 1answer

2.108 programming-challenge questions.

### 8 Pangrams CodeEval challenge

2 answers, 1.020 views python beginner programming-challenge
I took a challenge on CodeEval. Although the code seems to work for the examples taken from the site, I feel it is not really pretty and must be more complicated than it should be. Description: ...

### -1 Project Euler Problem 1 with Python 3 ideal solution

I have been playing around in hacker rank with Python these days, and now pulling my hair out on this question to solve the Euler's problem in the least time required. If we list all the natural ...

### 2 Climbing the Leaderboard: HackerranK, Terminated due to timeout

I have implemented my solution and I thought it was pretty efficient and passes most of the cases but seems like it fails some of the test cases when the input size is very large. I basically push ...

### -1 Project Euler Problem #23 (non-abundant sums) [closed]

Project Euler Problem 23 A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of \\$28\\$ would be \\$1 + 2 ...

### 1 HackerRank - Array Manipulation - Follow-up

2 answers, 213 views c++ algorithm programming-challenge
This is a follow-up question for HackerRank - Array Manipulation Problem You are given a list (1-indexed) of size \\$n\\$, initialized with zeroes. You have to perform \\$m\\$ operations on the ...

### 2 HackerRank - Array Manipulation

2 answers, 1.317 views c++ algorithm programming-challenge
This is my implementation for this hacker rank problem. (And a follow-up.) Problem You are given a list(1-indexed) of size n, initialized with zeroes. You have to perform m operations on the ...

### 2 Find the sum of all digits that match the following digit in a circular list

The challenge The captcha requires you to review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit ...

### 8 Python 3 two-sum performance

I just submitted a Python solution to the 'Two Sum' problem on LeetCode. The Problem Given an array of integers, return indices of the two numbers such that they add up to a specific target. ...

### 1 Code Vita 7: Form the maximum possible date time in the MM/DD HH:MM format using any eight of twelve given single digits

0 answers, 59 views python algorithm programming-challenge
The question is similar to my previous question but is quite different, hence I won't call it a follow up. I have made changes like fixing bugs and replacing bubble sort from review of previous ...

### 5 LinkedList class implementation in Python

I was solving this problem for implementing LinkedList and ListNode classes, and Insert and <...

### 6 Code Vita : Form the maximum possible time in the HH:MM:SS format using any six of nine given single digits

2 answers, 197 views python algorithm programming-challenge
Problem Description The objective is to form the maximum possible time in the HH:MM:SS format using any six of nine given single digits (not necessarily distinct) Given a set of nine ...

### 1 Project Euler 41 Generating Pandigital Numbers [on hold]

Project Euler question 41: We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime. ...

### 2 Forming all multiples of 3 using the given digits

I'm working on this kata from Codewars. The task is: Given a certain number, how many multiples of three could you obtain with its digits? Supose that you have the number 362. The numbers that ...

### Lattice path from Project Euler with Python solution

I was trying to solve this problem called lattice path from Project Euler: Count the number of unique paths to travel from the top left to the bottom right of a lattice of squares. How many such ...

### 3 Merge intervals

Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. GitHub ...

### 2 Google Foobar level 3

2 answers, 84 views java programming-challenge
Over the past few weeks, I've been doing the Google Foobar challenges and I've been progressing quite well. I'm currently 1/3 of the way through the third level. However, there were plenty of times ...

### 8 Hackerrank : Hash Tables: Ransom Note

I just solved the Hash Tables: Ransom Note problem on Hackerrank using both Java-8 and Java-7. Given m words in a magazine and the n words in the ransom note, print ...

### 3 SPOJ GENERAL: sorting by swaps of distance k

I have been trying to solve this simple problem on SPOJ for quite some time now, but I keep on getting TLE (Time limit exceeded) for some reason. Since the problem is in Portuguese, a brief ...

### 2 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 \...

### 5 Pig Latin Anslatortray with not enough OOP

I've created a program that translates any word into the form of igpay atinlay or pig latin! I got the project idea from here: https://www.dreamincode.net/forums/topic/78802-martyr2s-mega-project-...

### 5 Are strings anagram

This is a question from the book "Cracking the Coding Interview". Write a method to decide if two strings are anagrams or not I think interviewer will not be convinced with this solution because ...

### 2 Search and Replace (FreeCodeCamp intermediate algorithm scripting)

I completed the challenge and passed the tests: Perform a search and replace on the sentence using the arguments provided and return the new sentence. First argument is the sentence to perform ...

### 5 Check if a string has all unique characters

This is a question from the book "Cracking the Coding Interview". Implement an algorithm to determine if a string has all unique characters What if you can not use additional data structures? I ...

### 1 “Flipping bits” Python implementation

Problem Statement You will be given a list of 32 bits unsigned integers. You are required to output the list of the unsigned integers you get by flipping bits in its binary representation (i.e. ...

### 1 Find all pairs in an array that sum to a given number without using HashMap

Find all pairs in an array that sum to a given number without using HashMap. Duplicate pairs are not allowed. Input array cannot be modified. input: ...

### 4 Remove duplicate characters in a string

This is a question from the book "Cracking the Coding Interview". Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer NOTE: One ...

### 5 In-place reverse of C-style string

This is a question from the book "Cracking the Coding Interview". Write code to reverse a C-Style String (C-String means that “abcd” is represented as five characters, including the null ...

### 3 Find k-distinct partitions which contain at least two perfect squares

Problem Statement: A k-distinct-partition of a number \\$n\\$ is a set of \\$k\\$ distinct positive integers that add up to \\$n\\$. For example, the 3-distinct partitions of 10 are \\$1+2+7\\$ \\$...

### 2 Code Vita : Chakravyuha

Problem Statement A Chakravyuha is a wheel-like formation. Pictorially it is depicted as below A Chakravyuha has a very well-defined co-ordinate system. Each point on the co-...

### 4 Generate Christmas Tree

Problem Statement: The Christmas tree is comprised of the following Parts Stand Each Part is further comprised of Branches. Branches are comprised of Leaves. How the tree appears as a ...

### 5 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 ...

### 4 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: ...

### 1 Finding the position in a triangle for the given challenge

The LAMBCHOP doomsday device takes up much of the interior of Commander Lambda's space station, and as a result the prison blocks have an unusual layout. They are stacked in a triangular shape, and ...

### 5 Codewars: N-dimensional Von Neumann Neighborhood in a matrix

Task: For creating this challenge on Codewars I need a very performant function that calculates Von Neumann Neighborhood in a N-dimensional array. This function will be called about 2000 times The ...

### 3 Solving maze problem with backtracking solution using stack

I solved the maze backtracking question using a stack however could not find any other solution like that anywhere (to validate my solution is actually a valid one). The problem statement is as ...

### 6 Finding intersting path in a graph

There is a question in a contest but it doesn't have any answer. I solve it but I get time limit for most of test case. Is it possible to improve my code or give a better approach? Question There is ...

### 4 Use Python to determine the repeating pattern in a string (no leftovers)

As a part of a challenge, I was asked to write a function to determine if there was repetition in a string (if no repetition, output is 1), and if a substring is repeated throughout the string (for ...

### 7 Counting ways to choose vertices that form a right triangle

Croatian Open Competition in Informatics, contest 3, December 8, 2007 4. DEJAVU \\$N\\$ points are placed in the coordinate plane. Write a program that calculates how many ways we can choose ...

### 5 Calculate Hamming distance between DNA sequences in Ruby

I am requesting a review for my solution to this problem from exercism.io. I'm posting it here since there is not always input on solution submitted through exercism. The problem is as stated: ...

### 9 Find the repeated elements in a list

You are given an array of n+2 elements. All elements of the array are in range 1 to n. All elements occur once except two numbers, which occur twice. Your task is to find the two repeating numbers. ...

### 2 Solving the Burst Balloon problem using Dynamic Programming

Continuing where I left off previously to solve the problem described here, I've now solved the same using dynamic programming (following Tikhon Jelvis blog on DP). To refresh, the challenge is to ...

### 10 Master Locksmith

Description Master Locksmith has just finished the work of his life: a combination lock so big and complex that no one will ever open it without knowing the right combination. He's done testing ...

Intro I've decided to learn haskell, because I've always enjoyed the functional aspect of Python and want to explore other languages that use this concept. I'm still stumbling in the dark most of the ...

### 4 Demonstration of Scale Balancing

2 answers, 81 views c++ algorithm programming-challenge
Have the function ScaleBalancing(int vector, int vector) read vectors which will contain two elements, the first being the two positive integer weights on a balance scale (left and right sides) ...

### 2 For names sake - Project Euler 22

2 answers, 84 views programming-challenge file julia
Project Euler - 22 Names scores Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin ...

### 6 Multithreaded testing for counting rooms from a floor plan solution

This is version 3 of Efficiently counting rooms from a floorplan. Version 2 is here Efficiently counting rooms from a floorplan (version 2) It also has a comprehensive test facility that is the ...

### 10 Efficiently counting rooms from a floorplan (version 2)

5 answers, 2.174 views c++ algorithm programming-challenge c++14
This is version 2 of Efficiently counting rooms from a floorplan. I had accidentally pasted in the wrong version of the code. Update Final version (version 3) of the code with updated test harness ...

### 6 Efficiently counting rooms from a floorplan

1 answers, 271 views c++ algorithm programming-challenge c++14
Note this was the wrong version of the code. The updated version is here: Efficiently counting rooms from a floorplan (version 2) My apologies! Update Final version 3 with test harness here: ...

### 4 Counting out game with std::list

I recently tried to solve the Josephus Problem on Sphere Online to help answer this question but am getting TLE for any solution I come up with. The exact parameters of the problem are: This is ...

### 7 Swiftly counting rooms in a floor plan

Inspired by recent questions about counting the rooms in a floor plan (1, 2, 3), here is my attempt to solve the problem with a Swift program. The problem (from “Counting Rooms” on CSES) is: You ...