Cody

Recent Activity

51 – 100 of 10,213

William submitted a Comment to Problem 45250. Be happy

Asif: If I am reading that reference correctly, then test suite problems 4 and 7 are incorrect. In fact, problem 4 has base b=4, and according to the reference b=4 is a "happy base" in which *all* numbers are happy.

on 5 Jan 2020 at 15:16

William submitted a Comment to Problem 45255. Find the sequence

Asif, Test suite problems 6-10 are pretty peculiar! Did you mean to have them that way?

on 4 Jan 2020 at 22:31

Chul Min Yeum submitted a Comment to Solution 785960

It's a very good idea!

on 4 Jan 2020 at 22:22

Raymond MacNeil submitted a Comment to Problem 1107. Find max

15.99% per annum.

on 4 Jan 2020 at 2:51

Asif Newaz submitted a Comment to Problem 45250. Be happy

https://en.wikipedia.org/wiki/Happy_number

on 3 Jan 2020 at 15:40

Ned Gulley submitted a Comment to Problem 45250. Be happy

Hi Asif: Can you give a little more detail to your solvers about what "happy" and "b-base' mean? Maybe link to Wikipedia reference pages?

on 3 Jan 2020 at 15:27

Chul Min Yeum submitted a Comment to Problem 38. Return a list sorted by number of occurrences

Good problem!

on 3 Jan 2020 at 12:14

Nico Noordam submitted a Comment to Solution 1094380

length not correct, use size(A,2)

on 3 Jan 2020 at 10:19

Nico Noordam submitted a Comment to Solution 1956898

not a general solution, will fail A=[1;2]. Use size iso lengt

on 3 Jan 2020 at 10:18

Bryan Lambo submitted a Comment to Problem 61. Find state names that end with the letter A

Be careful of the 2-word states. Converting to different formats boggles me

on 3 Jan 2020 at 8:19

Sarthak Saumya submitted a Comment to Solution 2075885

very easy...

on 3 Jan 2020 at 7:14

Asif Newaz submitted a Comment to Problem 43087. Move if I am Optimus Prime

what do u mean??

on 3 Jan 2020 at 6:11

Chul Min Yeum submitted a Comment to Solution 2077121

It's quite challenging!

on 2 Jan 2020 at 19:08

Piyush Pulukool submitted a Comment to Solution 1812771

true ;( and now this happened

on 2 Jan 2020 at 16:14

Veronica Taurino submitted a Comment to Problem 167. Pizza!

ahah nice one

on 2 Jan 2020 at 11:06

Carlo Venettacci submitted a Comment to Solution 2075885

Too easy...

on 1 Jan 2020 at 13:57

Raymond MacNeil submitted a Comment to Solution 1405581

Because if you do not double up (''), the single apostrophe is read by MATLAB as the end of the character vector. This is how you get around this.

on 31 Dec 2019 at 11:26

Raymond MacNeil submitted a Comment to Solution 2075072

A lot easier than I originally anticipated. Once you start setting up the problem variables, it comes together pretty easily.

on 31 Dec 2019 at 9:46

Asif Newaz submitted a Comment to Problem 2216. Given an input string, generate a variable name out of it

ur test suites gave me headache.. u jumbled upper and lower case

on 30 Dec 2019 at 18:55

Tim submitted a Comment to Problem 45245. String count

For some reason, according to Matlab function isstrprop, the characters $ + < = > ^ ` | ~ are not considered to be punctuation marks, or letters, or digits, or anything else--this seems to be discriminatory and unjust.

on 30 Dec 2019 at 15:59

Paresh yeole submitted a Comment to Solution 2071007

Why the first test case fails? It passes in the matlab.

on 27 Dec 2019 at 21:56

Asif Newaz submitted a Comment to Problem 45245. String count

Tim, I am not quite sure where did that amp came from in test-2. it wasn't in my original test suite. in test-3, grave accent is not a punctuation mark - so far i know.

on 27 Dec 2019 at 19:36

Asif Newaz submitted a Comment to Problem 45246. Count digits

@Bhaskar that means u need to find some alternate way to solve

on 27 Dec 2019 at 19:17

Tim submitted a Comment to Problem 45245. String count

I get [28 0 9 2 26 7] for test case 2 and [0 13 0 0 0 11] for test case 3.

on 27 Dec 2019 at 17:05

Yoshimasa Nakatani submitted a Comment to Solution 2070711

Thank you

on 27 Dec 2019 at 14:58

Bhaskar R submitted a Comment to Problem 45246. Count digits

In the 5th test case there is number n=10000675820025; which is very large number MATLAB is not accepting to get number from 1 to 10000675820025;

on 27 Dec 2019 at 1:20

Asif Newaz submitted a Comment to Problem 45239. Checkmate-02

william, yes u're right. my bad..i didn't see that pawn..there is a lot to look into i guess

on 26 Dec 2019 at 21:16

William submitted a Comment to Problem 2254. Possible Opponents Matrix for single-elimination tournament

Faulty test suite. The 'for v = 1:10' in problem 5 has a semicolon after it.

on 26 Dec 2019 at 15:25

William submitted a Comment to Problem 45239. Checkmate-02

Asif, Thanks for the clarifications. In problem 2, I was aware of the rook at h3, but there is also a pawn at h5 that makes Kh7 a legitimate solution I think (one that is harder to detect programmatically). As in problem 9, it complicates the solution a little more than you intended.

on 26 Dec 2019 at 1:59

David Hill submitted a Comment to Solution 2069153

Can Cody not handle nested functions?

on 25 Dec 2019 at 23:56

David Hill submitted a Comment to Solution 2069099

Not sure why this solution is not working. It runs and works when I run it on my matlab.

on 25 Dec 2019 at 21:39

Asif Newaz submitted a Comment to Problem 2674. Generalised Hamming Number

is there any mathematical algorithm that i dont know about to calculate such big range(10^13)? i minimized my code as best as i can.still fails for such large number.

on 25 Dec 2019 at 20:33

Asif Newaz submitted a Comment to Problem 81. Mandelbrot Numbers

@Ratchet_Hamster for complex no, u need to take the absolute value to check if it is greater than 2

on 24 Dec 2019 at 22:39

Asif Newaz submitted a Comment to Problem 45239. Checkmate-02

William, thanks man. There was a bug in my code regarding the other king. i've corrected it. so 3. solution of 3 -- {Kc7,Kb8}. 1. solution of 2 -- {kg7,kf5} .. but not kh7 -- look out!!! there is a rook in the column-h. 2. In prob-7, the king is not currently in check.so he is not obliged to move. thats why empty. 2. in prob-9, yes the king can take out one of the knights & avoid check. Initially when i wrote this code, i didn't take into account the possibility of the king taking out another piece of the opponent. that would complicate the situation further. I kept it for 'checkmate-03'.

on 24 Dec 2019 at 19:43

William submitted a Comment to Problem 45239. Checkmate-02

Asif, I think that several of the problem solutions need review. 1. In problem 2, 'Kf7' should not be in the solution since it is adjacent to 'Ke7'. Isn't the correct result {'Kh7',''Kg7','Kf5'}? 2. In problem 7, the king could take any of the knights. Is the solution listed as pos = [] because there are 3 knights on the board? If so, why is the solution to problem 9 listed as 'checkmate'? If not, a solution to problem 9 would be {'Ka3','Ka2'}. Similar questions apply to problem 8. 3. Why is 'Kc7' not in the solution of problem 3? I'm afraid I have a lot to learn about chess!

on 24 Dec 2019 at 16:43

William submitted a Comment to Problem 45238. Checkmate

Asif, Aha! Tricky, and very clever. Thanks for posting this interesting problem!

on 23 Dec 2019 at 15:52

Nico Noordam submitted a Comment to Solution 2052986

Yes. Also this solutions will fail fib(0)

on 23 Dec 2019 at 13:08

Asif Newaz submitted a Comment to Problem 45238. Checkmate

william, i might not have understood u totally. what i meant to say is that -- there are some invalid position/moves. for example, the pawn can jump from a2 to a4 but not from a3 to a5-thats an invalid move. similarly a white pawn can never be at the location a1-- their position starts from a2-so placing a pawn in row-1 is an invalid move. in test-6, the pawn in e1 could check the king - but its own position is invalid.it could not be in that position in the 1st place. thats why 0. in test-2,3; the pawn is in h6. a pawn can be in the column-h or row-6.so thats a valid position. https://en.wikipedia.org/wiki/Pawn_(chess)

on 23 Dec 2019 at 1:34

William submitted a Comment to Problem 45238. Checkmate

Asif, Thanks, but my point is that the pawn is in row-1 in *both* cases, so they should both be in check or neither should be in check. Since you described 'x' as being the 'opponent King', I think that both should be in check.

on 22 Dec 2019

Asif Newaz submitted a Comment to Problem 45238. Checkmate

William, the opponent's pawn can never be in row-1. they can only move/check forward.

on 22 Dec 2019

William submitted a Comment to Problem 45238. Checkmate

Asif, I really like this problem, but I don't understand why 'h6' has 'Kg7' in check in Problem 2, but 'e1' does not have 'Kf2' in check in Problem 6. Aren't these two situations the same?

on 21 Dec 2019

Pooja Lalan submitted a Comment to Problem 44949. Find the Best Hotels

Thanks Richard. I have modified the problem description to mention this.

on 20 Dec 2019

Paresh yeole submitted a Comment to Problem 43236. Find my daddy long leg (No 's')

Test cases should contain test case having ration less than 1

on 20 Dec 2019

Bryan Lambo submitted a Comment to Problem 68. Kaprekar Steps

Very nice. Took some few minutes to crack this. What I did is to convert x into string and then use sort function.

on 20 Dec 2019

Shlomo Geva submitted a Comment to Solution 2064693

This solution actually fails on the assertion when using the following test (my own). It happens because of computational precision produced from using linspace() // out by about 0.222 * 1.0e-15. s = { ... 'Day Temp' ' 1 1.3' ' 5 9999' ' 6 9999' ' 5 9999' ' 6 9999' ' 2 1.12' ' 3 17' ' 4 16' ' 5 9999' ' 6 9999' ' 7 19'}; t_correct = [1.3 1.264 1.228 1.1920 1.156 1.12 17 16 17 18 19]; assert(isequal(read_and_interp(s),t_correct));

on 20 Dec 2019

Bryan Lambo submitted a Comment to Problem 70. Alphabetize by last name

This blew my mind. Finally got it.

on 20 Dec 2019

Pooja Lalan submitted a Comment to Solution 2059232

Thanks Paresh. Your approach is a valid solution that the tests were not designed to evaluate previously. I have now modified the tests to pass this alternative approach. However, there are two other issues with this solution, which you will have to resolve: 1. The color 'b' expected for the line is not the same as the default blue color the MATLAB uses. 2. The output is expected to be the minimum value of y, not a handle to the plot. I have also added appropriate messages for the tests. Thanks again!

on 19 Dec 2019

Andrea Gasparri submitted a Comment to Problem 1035. Generate a vector like 1,2,2,3,3,3,4,4,4,4

Good problem. HINT: use command "repelem" Solution: A=1:n B=repelem(A,1:n)

on 19 Dec 2019

Asif Newaz submitted a Comment to Problem 199. hanoi towers II

what do you mean by unused..can u elaborate?

on 19 Dec 2019

51 – 100 of 10,213