Questions tagged [puzzle]

DO NOT USE - prefer constructive questions, or use more descriptive tags. Otherwise, your question might be appropriate for codegolf.stackexchange.com.

DO NOT USE - prefer constructive questions, or use more descriptive tags. Otherwise, your question might be appropriate for CodeGolf.


The questions tagged "puzzle" are essentially programming questions, that are as good as solving puzzles. These can be contrasted to the real-life problems, which are comparatively easy to solve.

859 questions
-1
votes
2 answers

Should return how many letters repeated consecutively 3 times in a string,without using regex...use only core concepts

Example : If I pass "BAAABA" should return 1, as we see that "A" is repeated immediate 3 times. When I pass "BAABAA" should return 0, as we don't have any letter repeated immediate 3 times. when I pass "BBBAAABBAA" should return 2. Code which I…
jadhu
  • 1
  • 2
-1
votes
1 answer

How do I use sed like cut -d':' -f2?

I'm trying to learn sed and cant figure this one out. I found this: sed -e ‘s/^[^=]*=//’ for picking up "valueA" from "valueA=value" but the data I'm working with is this: Continent:Area(sq. mi):Density(People per sq.…
Charles Thompson
  • 135
  • 1
  • 1
  • 6
-1
votes
1 answer

Puzzle hint verbage unclear - unsure how to decode/decrypt message

I'm working on solving a puzzle and I ran into a phrase (see in bold below) that seems to be more puzzling than the puzzle itself so far. Here's what the puzzle says: The password is [64bit hex code here]. Use it to decode the message below. [Hex…
-1
votes
2 answers

Xamarin Forms: How to generate a word search puzzle matrix?

I am trying to implement a word search game on my Xamarin forms application. Only words are getting when I call my service. With these words how can I generate a letter matrix? I need a 10x10 letter matrix like below screenshot: The words are…
Sreejith Sree
  • 3,055
  • 4
  • 36
  • 105
-1
votes
1 answer

How to print a matrix in clockwise order

There is matrix for [x][y] order. i want to print its value in clockwise order I have tried several methods but unable to write the logic of the code. I'm trying it in java but logic is important so you can help me in any language.
-1
votes
1 answer

How to increment arrival date of request by one ms if same

I need a java utility method in java (for my application which get thousands of request coming in a second), which has following feature. The request has arrivaltime in format of (DD-MM-YYYY-HH:MM:SS) and bucketNumber (1-100). I want that if for…
Laxmikant
  • 1,551
  • 1
  • 13
  • 30
-1
votes
1 answer

Python - Countdown timer that exits program after given time

I'm pretty new in Python, and I'm working with my colleagues from college on simple puzzle project. We want to update the program and add timer & reset button to it. The idea of timer is to countdown for X minutes and then show some message with…
Tuna
  • 1
  • 6
-1
votes
1 answer

Capitalization of first instance of matching character in a crosswords puzzle

def find_word_horizontal(crosswords,word): for rows in crosswords: string=''.join(rows) if word in string: #finding index row_index=crosswords.index(rows) column_index=rows.index(word[0]) …
ohid
  • 824
  • 2
  • 8
  • 23
-1
votes
1 answer

Unbounded two egg puzzle

The `two egg problem' is a well-known puzzle and over-used interview question. (See eg Generalised Two-Egg Puzzle) My question is a variant: come up with an algorithm that works when the maximum number of floors is not known before-hand. Compare…
Matthias
  • 133
  • 2
  • 10
-1
votes
2 answers

Programming puzzle: volume of liquid in a container with partitions

One of my friends was asked the following problem in an interview: Consider a rectangular container with several thin partitions. The cross-section of the container looks like the following: | | | | | | | …
PTDS
  • 217
  • 3
  • 8
-1
votes
1 answer

How many small squares needed to fill a rectangle?

I am trying to solve a problem on codeforces. I am a beginner and I am just trying to understand how to solve this problem I do not want to copy someone's code. Requirements are : There is 1 big rectangle of n * m units. (n and m are length and…
Deepak
  • 1,503
  • 3
  • 22
  • 45
-1
votes
1 answer

Filling the 2d array

I need to fill in a 6x6 array using only one arithmetic expression, so it's gonna look like that: 1, 2, 3, 4, 5, 6 2, 3, 4, 5, 6, 1 3, 4, 5, 6, 1, 2 4, 5, 6, 1, 2, 3 5, 6, 1, 2, 3, 4 6, 1, 2, 3, 4, 5
GBarkhatov
  • 17
  • 5
-1
votes
1 answer

Using search to solve the 15-puzzle

I'm trying to write a 4 x 4 grid using vertical bars and underscore. I have a class for the puzzle, but i want to know what fields and methods i can use to represent and manipulate a configuration for the puzzle. Reference: Fifteen puzzle
dan
  • 103
  • 1
  • 1
  • 2
-1
votes
2 answers

Creating a puzzle

For my study I need to create a binary puzzle in Python like this: First I need to make a game board for it, as in the image. I'm trying to create a 6 by 6 board. The player must be able to enter a 1 or 0. How do I create the board so that the…
Kruko
  • 13
  • 4
-1
votes
2 answers

Balanced Parenthesis Order number

Suppose if you consider the case of length-six strings, the order would be: “()()()”, “()(())”, “(())()”, “(()())”, “((()))”. In the above example, if we see that the strings in which the first opening parenthesis is closed the earliest come first,…
Rohit
  • 635
  • 6
  • 12
  • 22