Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
PLEASE NOTE: I am not looking for code, but for a way how to solve this problem.
My input is world that looks like this:
The problem is, i have to find the biggest number, without using OWN variables I could declare myself, and I'm only allowed to use turnLeft(), turnRight(), move(), isLeft/Right/FrontClear(), getNumber() and putNumber() functions to move < around the world.
Could you please give me a 'verbal solution' or a hint how to do such thing?
While you cannot use any variable, note that you do have available memory (getNumber() and putNumber()). For instance, you could think about leaving a mark in positions you have already been to implement some kind of flood fill.
Further, you can fill the floor with the biggest number you have seen yet. Basically, encoding your own state in the floor.
Important questions:
Is the configuration of the maze always fixed?
Is the range of possible numbers in the floor fixed to a reasonable range (e.g. digits 1-9)?
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 months ago.
Improve this question
I have a Google Sheet which is constantly being populated via a Zapier zap. In one of the columns, I receive a PayPal "descriptor" which contains a unique identifier I need to do some look ups on other tabs within the same document.
Can someone point me in the direction of the correct REGEX to use to strip off the front and end of the string, for example:
Annual Fee-66421763-07142022191540
I would like to just have the piece in between the hyphens so the output reads simply:
66421763
Now, the front section will likely always read the same, the middle (the piece I want to extract) will be different and could change length too, as will the end section after the dash.
Any suggestions on how to achieve this would be great.
try:
=REGEXEXTRACT(A1; "-(\d+)-")
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've seen a lot of article mentioning these 'Magics' like 'Magic Tables', 'Magic Columns', 'Magic Number', etc. What are they, really? Please give a concise explanation and example for these 'magics'.
[Edit]
The link below says that rownum is a magic column
http://www.oracle.com/technetwork/issue-archive/2006/06-sep/o56asktom-086197.html
Is it a general term?
I bet that the text is just using a metaphoric expression but there is a very similar term in programming called Magic Strings and Magic numbers. You can see in the wikipedia there are several meanings.
I personally think on the meaning of:
Unique values with unexplained meaning or multiple occurrences which
could (preferably) be replaced with named constants
This means that it is better to write:
for(int = 0; i < MAX_ATTEMPTS; i++){
Than
for(int = 0; i < 20; i++){
See this stackoverflow answer for more information why magic numbers/strings is an anti-pattern
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is Foreach loop a definite or indefinite one? Meaning do I know prior to the execution of the loop the number of iterations it is going to do?
No. foreach in most languages (c#, java) doesn't know beforehand how many iteration it will have to do. You could even use foreach to go through an infinite sequence.
That's why for exists
In most languages a foreach loop will iterate over a collection of elements until the collection ends. In most languages I can think of a collection can be a definitive set of elements contained in memory OR a calculated set of elements that could in theory be of an infinite length. This would make the foreach loop "indefinite" in most modern languages.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a map that I want to separately count the patterns of different numbers.
Without VB, I want to be able to create a dynamic counter that will be able to count the patterns of numbers.
For example:
I want to count how many times, even if it overlaps that this pattern occurs in the map
2 2
2 2
Counting I can see the pattern occurs six times but I'm struggling to create a simple array formula that will be able to do so
I've been told of success with and IF function with nested AND functions so I know it can be done without VB.
Use the formula
=COUNTIFS(A1:E15,2,B1:F15,2)
notice how the two areas are adjacent - one column offset from each other.
You can extend this to find two-by-two regions:
=COUNTIFS(A1:E14,2,B1:F14,2,A2:E15,2,B2:F15,2)
just be very careful about how the different ranges are offset.
An alternative way to write this which, I suspect, will be more efficient for large ranges is:
=SUMPRODUCT((A1:E14=2)*(B1:F14=2)*(A2:E15=2)*(B2:F15=2))
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I want to get mobile number by using sim card serial number only.
Is there any way to get it??
Please let me know.
Hope to hear from you soon.
Regards,
Parmanand Soni
You cannot get the mobile number from the SIM ICC ID.
The own number is included in the IMSI, but it's not usually possible to write an algorithm to retrieve it that will work for all SIMs, because it is prefixed by the country and operator codes, and the operator code has a variable length.
Own number can often be retrieved via a USSD dialogue, but this varies from operator to operator.