# Tagged Questions

Programming challenges are off-site challenges meant to offer programmers educational experiences while testing their abilities.

18 views

### Printing staircase revisited

What can be more elegant ways to solve the given problem. # ## ### #### Code: ...
24 views

### Sum of all paths between all pairs of nodes in a tree

I'm trying to solve a competitive programming problem. It basically gives a undirected graph (tree-like: no multiple paths between two nodes...) and asks for the sum of all possible paths between any ...
12 views

### Encoding and decoding in Haskell — 99 Problems exercise 13, 14

I've been working on these solutions to the Haskell 99 questions, encoding and decoding series for a while now, so I figured I ought to present them to see how I screwed up the implementation. ...
24 views

### Finding longest common prefix

I have been trying to solve a modification of the Longest Common Prefix problem. It is defined below. Defining substring For a string P with characters P1, P2,…, Pq, let us denote by P[i, j] ...
22 views

### Hackerrank Sparse Arrays in Swift

I solved this problem and was looking for feedback on my code. More efficient, cleaner, more verbose variable names, anything helps. There are N strings. Each string's length is no more than 20 ...
906 views

### Morse Code Conversion

Challenge Write a program which reads a file containing Morse Code and outputs the conversion. Specifications The first argument is a path to a file. The file contains multiple lines. Each line ...
48 views

### HackerRank Array left rotation using Swift

I solve this problem in Swift. Looking for feedback on my code or a better solution: ...
51 views

### Take two sets of randomly-sorted scores and find their common improvement percentage [on hold]

I was studying for an upcoming phone interview, and Googling programming terms which I needed to strengthen myself in. Well after I Googled "Dependency Injection", a banner appeared asking if I ...
61 views

### Evaluating a completely parenthesized arithmetic expression

I tried to solve the following problem in a programming challenge, but the verdict was time limit exceeded. Completely parenthesized expression Write a program that reads a completely ...
17 views

### LCA in binary search tree failing for one edge case [on hold]

Here is the hacker rank link ...
40 views

### Swift Hackerrank Dynamic Array

I've solved this question. Wasn't sure if I was suppose to use a dictionary in this case, as the question was to use a dynamic array, but I didnt know how else to do it. Was wondering if I can get ...
58 views

### Swift Hackerrank 2D Array

I solved this question in Swift, but was wondering if there is a better way or if my code can be improved: Given a 6x6 2D Array: ...
631 views

182 views

### Project Euler 4: Largest palindrome product

This solves Project Euler 4: Largest palindrome product using C# (specifically, using LINQPad). Any and all suggestions for improvements to either the C# code or the math/algorithm are very welcome. ...
30 views

### 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 ...
60 views

### HackerRank “Nested Lists” Code

I completed the "Nested Lists" challenge on HackerRank, and would love any feedback on my code. My program is fed text with the number of students in a classroom, the name of a student, and their ...
850 views

### Largest Prime Factor (PE3) using OOP

I want to learn some C# syntax/paradigms (I'm more used to Java), and have been wanting to get a bit better at math as well, so I solved ProjectEuler3: Largest prime factor with the following small ...
66 views

### Calculating protein mass

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see A sequence of mistakes. The repository with all my up-to-date solutions so far can be ...
60 views

### Scrabble tile-counting challenge

While reviewing this Scrabble Tile Counter, I decided to give it a try myself. Here is the challenge, from Reddit's /r/dailyprogrammer: Description For this challenge we will be using the ...