Cody

Recent Activity

1 – 50 of 5,001

Asif Newaz submitted a Comment to Problem 2309. Calculate the Damerau-Levenshtein distance between two strings.

i am facing a problem with ur test suite 5. is it correct? even the built-in matlab function 'edit distance' is giving the result 3. which i believe is the correct one. if i am not wrong, according to demarau algorithm - here transposition will not occur.

on 25 Jan 2020 at 14:35

William submitted a Comment to Problem 45275. Solve Sudoku puzzle step by

Hello BinBin, This is a good problem! But I am wondering: In the test suite, shouldn't the statement "tt = mat2cell(s,[3,3,3],[3,3,3]);" be inside the for-loop?

on 25 Jan 2020 at 14:18

Jonathan submitted a Comment to Problem 45258. Restricted Addition v2

That's a big part of this challenge. It's not an unintended side effect. Rather, it's a restriction designed to promote more exotic answers.

on 25 Jan 2020 at 2:09

Hans Kramer submitted a Comment to Problem 44316. Pandigital Multiples of 11 (based on Project Euler 491)

This one took a while.

on 24 Jan 2020 at 12:22

Asif Newaz submitted a Comment to Problem 2561. expand intervals vol.3

problem statement is a little vague

on 22 Jan 2020 at 17:54

Paresh yeole submitted a Comment to Problem 967. Split a string into chunks of specified length

Problem Description says, function should return n*1, however the solutions are 1*n. Kindly, edit the problem description.

on 22 Jan 2020 at 17:00

Marco Peduto submitted a Comment to Problem 167. Pizza!

bona la pizza

on 22 Jan 2020 at 14:25

Ling Liang submitted a Comment to Problem 615. Nilpotent matrix

May I ask what is the definition of Nilpotent matrix. I suppose that is A^k =0 for some k? If I am right, then 0 must be an eigenvalue of A, then there is some issues for the test problems.

on 19 Jan 2020 at 16:12

Giovanni Valentini submitted a Comment to Problem 2441. Bernoulli's Equation

Bernoulli's law is one of the most charming equations in Physics.

on 19 Jan 2020 at 13:48

Jack Hoayun submitted a Comment to Problem 149. Is my wife right?

Yes

on 15 Jan 2020 at 16:16

zaid aldailami submitted a Comment to Problem 2631. Flip the vector from right to left

Nice tricky problem y=x(end:-1:1) I think this might help

on 15 Jan 2020 at 14:48

Dejia Kong submitted a Comment to Problem 1198. Handle to an array of functions

what is "cf" in the code? Thanks.

on 14 Jan 2020 at 14:23

Aleksandrov Igor submitted a Comment to Problem 11. Back and Forth Rows

This code b=vec2mat(1:n^2,n) b(2:2:end,:)=fliplr(b(2:2:end,:)) work in Matlab, why it doesn't works on site?

on 14 Jan 2020 at 13:13

Nicolas Douillet submitted a Comment to Problem 45262. Remove duplicated vertices

This function is actually one basics of any mesh processing librairy / software.

on 13 Jan 2020 at 14:51

Asif Newaz submitted a Comment to Problem 45192. check whether a number is a pentatope number

test suites have been updated

on 12 Jan 2020 at 14:46

Asif Newaz submitted a Comment to Problem 1174. Wheat on a chessboard pt 2

how to place negative amount of 'wheat' on a chessboard? the prob is gd but the test suites are unnecessarily jumbled up.

on 12 Jan 2020 at 11:36

Asif Newaz submitted a Comment to Problem 136. Read a Soroban Abacus

nic problem

on 12 Jan 2020 at 6:07

Asif Newaz submitted a Comment to Problem 45250. Be happy

william, thanks man.. sorry i didn't go through all that info. i've updated the problem.it should be okay now

on 11 Jan 2020 at 9:27

ren yi xin ren submitted a Comment to Problem 41. Cell joiner

function out_str=cellstr_joiner(in_cell, delim) L=strlength(in_cell); n=length(L); summ=L(1); m=length(delim); for k=2:n-1 L(k)=summ+L(k); summ=L(k); end L(end)=[]; out_str=cell2mat(in_cell); for i=1:length(L) out_str=strcat(out_str(1:L(i)),abs(delim),out_str(L(i)+1:end)); L=L+m; end end who can tell me why my code is wrong.thank you

on 11 Jan 2020 at 3:24

Tim submitted a Comment to Problem 45258. Restricted Addition v2

Testing for 'e' when you only want to eliminate 'eval' is rather unfair.

on 10 Jan 2020 at 21:47

William submitted a Comment to Problem 45250. Be happy

Asif, Yes, I looked at the information on non-trivial perfect digital invariants. Near the end of that reference, there is a short section entitled "Relation to happy numbers" that indicates that in order for a number to be happy, it needs to be a perfect digital invariant with the value of 1. In this case, the invariant is 8 (or 22 in base-3), so I interprete that as saying that it is a non-trivial PDI, but not happy.

on 10 Jan 2020 at 18:10

Stephan Allgeier submitted a Comment to Problem 93. Calculate the Levenshtein distance between two strings

I really like this problem. So far, this is the one I had to think about most. Mostly because the straight-forward recursive implementation is simply not feasible for longer inputs.

on 10 Jan 2020 at 13:31

Nicolas Douillet submitted a Comment to Problem 45261. Query every vertices neighbor indices

Pedagogic solution is available in position 2 (commented, same as solution 1 but more explicit thus suboptimal).

on 10 Jan 2020 at 9:40

David Motson submitted a Comment to Problem 66. Find the two-word state names

@Cody Team, does this need to be a Cody Challenge? It's a pretty rubbish problem

on 10 Jan 2020 at 8:51

Asif Newaz submitted a Comment to Problem 45250. Be happy

william did u look into the nontrivial PDI portion? i might have been wrong-i 'll look into it when i get some time. i'm a bit busy now with my new job

on 8 Jan 2020 at 7:29

Chul Min Yeum submitted a Comment to Problem 2572. Counting down

what is the input 'x'?

on 8 Jan 2020 at 3:58

Bryan Lambo submitted a Comment to Problem 95. Given two strings, find the maximum overlap

This did not make me sleep. Most difficult so far, took me some few hours lol.

on 8 Jan 2020 at 0:18

Alex Suchik submitted a Comment to Problem 45251. Last non-zero digit

f so, perhaps you are not applying the dosing in the same way when doing simulations.

on 7 Jan 2020 at 9:45

William submitted a Comment to Problem 45250. Be happy

Well, it appears to me that the number 742356 is a pre-periodic point of the perfect digital invariant n=8 in base 3. However, since the perfect digital invariant is n=8 rather than n=1, this is not a happy number. At least, that is how I read it!

on 6 Jan 2020 at 19:30

Asif Newaz submitted a Comment to Problem 45250. Be happy

william, so far i've understood the concept, test-6 is correct. https://en.wikipedia.org/wiki/Perfect_digital_invariant have a look..I think it'll make things clear but still if i'm wrong,do inform

on 6 Jan 2020 at 16:41

William submitted a Comment to Problem 45250. Be happy

Asif: Yes, I am now seeing a discrepancy with problem 6, but all the others agree with my code.

on 6 Jan 2020 at 4:06

Bryan Lambo submitted a Comment to Problem 55. Counting Sequence

This only took me a few minutes until I saw Case 5 haha! Fun and mind boggling

on 6 Jan 2020 at 3:00

Asif Newaz submitted a Comment to Problem 45250. Be happy

thank u william for pointing that out. i've modified the test suites. kindly inform if u find any more discrepancies.

on 5 Jan 2020 at 23:25

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

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

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

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

Veronica Taurino submitted a Comment to Problem 167. Pizza!

ahah nice one

on 2 Jan 2020 at 11:06

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

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

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

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

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

1 – 50 of 5,001