# programming-challenge's questions - English 1answer

2.034 programming-challenge questions.

### 1 A Structured FizzBuzz

Warning Wall of text, little bit of code. This question is about as much as introducing the language as it is about whether or not I still know how to write the language. Introduction Programmable ...

### System on Chip Validator

With reference to my source files, published in the git repository soc-testing I did my best effort at coding, based on 30 years of experience, so I would like to know what I did wrong with my ...

### 8 Project Euler Problem #7 in Python (10001st prime number)

I have managed to solve the 7th Project Euler problem, however I think it can be improved by a lot, I am by no means a professional programmer or even consider myself really good at it. Any ...

### 2 SPOJ problem: Life, the Universe, and Everything

Your program is to use the brute-force approach in order to find the answer to Life, the Universe, and Everything. More precisely, rewrite small numbers from input to output. Stop processing input ...

### 3 Swift solution to Leetcode “Longest Substring Without Repeating Characters”

From LeetCode medium 3. Longest Substring Without Repeating Characters: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", ...

### 4 Sort a linked-list with only three distinct values

I am trying to solve this problem. The problem is to sort a linked list containing only 0s, 1s and 2s by changing their links. Sort a linked list of 0s, 1s and 2s by changing links Given a linked ...

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

### 2 Brute force solution to Project Euler Problem #52

2 answers, 63 views c++ programming-challenge c++14
I was solving Project Euler Problem #52: It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive ...

I have solved a spoj question CLASS LEADER. For each test case there are n students and a paper will be given to student m and now the game starts, the student m will pass the paper by o positions ...

### 2 Determine if 1 Queen can take King

1 answers, 54 views programming-challenge vb.net chess
This challenge was pretty simple - be given the coordinates of a king and a queen on a chess board and determine if the king is in check. Input is the number of test cases with each test case on a ...

### 4 Checking whether if start and end has equal number of non-zero integers and contains 3 or more 0 in the center

3 answers, 158 views java programming-challenge
An array is said to be hollow if it contains 3 or more zeros in the middle that are preceded and followed by the same number of non-zero elements. Write a function named ...

### 3 Bovine Shuffle using a queue (USACO Dec 2017 Silver)

I am working on the "Bovine Shuffle" problem from the December 2017 USA Computing Olympiad, and have got it to work for every test case beside two. When I run these two cases on my own computer, they ...

### -1 Project Euler Problem #12 - Highly divisible triangular number

1 answers, 208 views python programming-challenge
Project Euler Problem #12 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would ...

### 7 Find K biggest numbers in the array

I was trying to implement method number 2, from this article. Method 2 (Use temporary array) K largest elements from arr[0..n-1] Store the first k elements in a temporary array temp[0..k-1]....

### 2 Merge a new interval into given array of intervals

1 answers, 79 views python programming-challenge interval
This is Merge Intervals problem from www.interviewbit.com Problem : Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that ...

### 3 SPOJ Emoticon challenge

I tried this spoj problem and solved it using Dynamic Programming, but I was getting Time Limit Exceeded. The challenge is to count the number of occurrences of the subsequence "KEK" in each input ...

### 2 Rearranging numbers of an array like a wave

Given an array of integers, sort the array into a wave like array and return it, In other words, arrange the elements into a sequence such that a1 >= a2 <= a3 >= a4 <= a5..... Example ...

### 3 Python Find the N adjacent digits in the 1000-digit number that have the greatest product

This question was presented to me, adapted from Project Euler #8. The goal is to find the N adjacent digits in the 1000-digit number that have the greatest product. Range of N: 10 <= N <= 50. ...

### 2 Finding the maximum GCD of all pairs

The code below is for Hackerrank competition. Seems that it works correctly but performs very slowly and because of it can't pass some tests. The task is to find the maximum GCD of all possible pairs ...

### 8 Rearrange list by modifying the original list, put even-index values at front

I am relatively new to python and I am still trying to learn the basics of the language. I stumbled upon a question which asks you to rearrange the list by modifying the original. What you are ...

### 2 Program to shorten URL and decode it back to get original URL

TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL.Design the encode and ...

I tried to make a python code that would answer the Joseph problem. I really had a hard time with this and the try blocks was the only thing I could come up with. Can anyone tell me if the way I did ...

### 3 2D array inquiries

I am trying to solve a problem as described below: You are given an input of a n*m forest. You have to answer a group of inquiries. Your task is to return the number of trees for every ...