Christian Schröder
5
5
Rank91
91
Badges51811
51811
Score
Christian Schröder submitted Solution 14583086 to Problem 60830. Compute the saturation concentration for dissolved oxygen in water on 23 Mar 2025 at 10:32 |
Christian Schröder submitted a Comment to Problem 60826. Identify Similar Rows in a Matrix Based on Sequence of Non-zero Elements Thanks, William. I'm unsure how the problem description could be understood such that there is ever a case where a row (even an all-zero row) is not similar to itself, but unless and until the author provides clarification we may never know what's intended.
To the author: I would also suggest that when checking whether a matrix is empty, you use isempty(...) rather than isequal(..., []) since the latter also checks the size, and [] is specifically a 0×0 matrix.
on 22 Mar 2025 at 10:47 |
Christian Schröder submitted Solution 14582368 to Problem 60826. Identify Similar Rows in a Matrix Based on Sequence of Non-zero Elements on 22 Mar 2025 at 10:44 |
Christian Schröder submitted a Comment to Problem 1092. Decimation @Jason the key realization that'll address all the concerns you raise is that you shouldn't think of decimation as happening in discrete rounds to begin with.
Instead, imagine that the prisoners are standing in a circle, and Carnage Maximus is standing in the middle, pointing to each living prisoner in turn. When the number of times he has pointed is divisible by kill_every, then that prisoner is taken away to be executed, and the decimation process continues. The circle is now smaller - but Carnage Maximus is ignorant of this and simply keeps on pointing.
In other words, in the example, you start with this sequence of prisoners (this is what you'd get if you pointed to each person in the circle in term, without ever taking anyone away):
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 ...
After 3, 6 and 9 have been removed - with Carnage Maximus still pointing at the empty spot where 9 used to stand -, the circle is now
1 2 4 5 7 8 . 10 1 2 4 5 7 8 10 1 2 4 5 7 8 10 1 2 ...
and the . is where Carnage Maximus is pointing. Moving on, the 3rd and 6th prisoners he points to next are 2, 7, so the circle is now
1 4 5 . 8 10 1 4 5 8 10 1 4 5 8 10 ...
Now the 3rd and 6th prisoners he'll point to next are 1 and 8, after which the circle is
4 5 . 10 4 5 10 4 5 10 ...
Then 5 is removed next,
4 . 10 4 10 4 10 ...
and after that 10 is removed, leaving 4. I hope that this clears up what's happening and why it does, in fact, make perfect sense!
on 20 Mar 2025 at 21:41 |
Christian Schröder submitted Solution 14581366 to Problem 60829. Basic Identity Function on 20 Mar 2025 at 17:37 |
Christian Schröder submitted Solution 14581365 to Problem 60828. Remove Duplicate Words from a Sentence. on 20 Mar 2025 at 17:36 |
Christian Schröder submitted a Comment to Problem 60826. Identify Similar Rows in a Matrix Based on Sequence of Non-zero Elements I'm not sure I understand your notion of similarity. Suppose we've got rows r1 and r2, and let r1n and r2n denote r1 and r2 with trailing zeros removed. By your first condition, for r1 and r2 we must have that r1n equals r2n. But since the remainder of r1 and r2 is zeros, this implies that r1 and r2 are also equal, yet this is clearly not what the test suite expects.
I don't think that this can be cured by reading the problem description differently either. In particular, your test suite indicates that for a zero matrix, the result should be empty, yet I cannot conceive of a sensible notion of similarity by which the first row is not similar to itself.
I also would like to point out that in your solution template (which does not pass the test suite) what the code does is at odds with what the comments say it does.
on 20 Mar 2025 at 17:35 |
Christian Schröder submitted a Comment to Problem 60822. Calculate the Number of Moles Mass is moles times molar mass, not moles divided by molar mass - or perhaps you meant to write Moles = Mass (g) / Molar Mass (g/mol).
Also, the test suite expects solutions to return 0 when a molar mass of zero is provided, not Inf.
on 19 Mar 2025 at 18:55 |
Christian Schröder submitted Solution 14580383 to Problem 60821. Remove Duplicate Words from a Sentence on 19 Mar 2025 at 18:52 |
Christian Schröder submitted Solution 14580379 to Problem 60822. Calculate the Number of Moles on 19 Mar 2025 at 18:50 |
Christian Schröder submitted Solution 14580373 to Problem 60823. Sum of Even Numbers in a Vector on 19 Mar 2025 at 18:46 |
Christian Schröder submitted Solution 14579236 to Problem 60819. Sum of Positive Elements in a Matrix on 18 Mar 2025 at 19:42 |
Christian Schröder submitted a Comment to Problem 70. Alphabetize by last name @Brent the extra space is be immaterial: it's outside the string. The problem with your earlier non-scoring solutions is the "F." in "John F. Kennedy", which your solutions mistakenly removed
on 17 Mar 2025 at 7:11 |
Christian Schröder submitted Solution 14576754 to Problem 42915. How Far Can You Throw Something? on 16 Mar 2025 at 8:31 |
Christian Schröder submitted a Comment to Problem 44958. Crop an Image @Rich imcrop() is part of the Image Processing Toolbox, and toolboxes are not available on Cody.
on 12 Mar 2025 at 7:14 |
Christian Schröder submitted Solution 14573263 to Problem 60816. Add 2 to any number. on 11 Mar 2025 at 19:35 |
Christian Schröder received Community Group Solver badge for YouTube-inspired on 9 Mar 2025 at 18:51 |
Christian Schröder submitted Solution 14571247 to Problem 59521. Integrate a power tower on 9 Mar 2025 at 18:51 |
Christian Schröder submitted Solution 14571012 to Problem 57477. Solve an equation involving primes and fractions on 9 Mar 2025 at 9:18 |
Christian Schröder submitted Solution 14570986 to Problem 56593. List the nth term of Rozhenko’s inventory sequence on 9 Mar 2025 at 7:44 |
Christian Schröder submitted a Comment to Solution 14564738 @Lloyd it does have one, in the [3 4 7] row of the input matrix.
on 3 Mar 2025 at 7:29 |
Christian Schröder submitted Solution 14558637 to Problem 859. Get the elements of diagonal and antidiagonal for any m-by-n matrix on 24 Feb 2025 at 22:03 |
Christian Schröder submitted Solution 14557506 to Problem 60813. Matrix Rotation by 90 Degrees on 23 Feb 2025 at 21:19 |
Christian Schröder received Community Group Solver badge for Electrical Engineering Problems - Part 1 on 21 Feb 2025 |
Christian Schröder submitted Solution 14551247 to Problem 60812. Estimating Monthly Electricity Cost for a Household Appliance on 18 Feb 2025 |
Christian Schröder submitted Solution 14551243 to Problem 60811. Voltage Divider Calculation on 18 Feb 2025 |
Christian Schröder submitted a Comment to Problem 60790. Implement Shor's algorithm Fair point. I've changed the test suite so that the function being written out is visible, for the sake of easier testing.
on 18 Feb 2025 |
Christian Schröder received Community Group Solver badge for Battery Management Systems - Level 1 on 17 Feb 2025 |
Christian Schröder submitted Solution 14550753 to Problem 60810. LED Current Calculation on 17 Feb 2025 |
Christian Schröder submitted Solution 14550752 to Problem 60809. Inductor Energy Storage Calculation on 17 Feb 2025 |
Christian Schröder submitted a Comment to Problem 60790. Implement Shor's algorithm @William it's created by the test suite, before the first test.
on 17 Feb 2025 |
Christian Schröder submitted Solution 14548450 to Problem 60807. Estimating the Range of an Electric Vehicle (EV) on 14 Feb 2025 |
Christian Schröder submitted Solution 14548446 to Problem 60805. Battery Charge Rate Calculation on 14 Feb 2025 |
Christian Schröder submitted Solution 14548444 to Problem 60806. Estimating Battery Backup Time for an Inverter on 14 Feb 2025 |
Christian Schröder submitted Solution 14548442 to Problem 60804. Battery State of Health (SoH) Calculation on 14 Feb 2025 |
Christian Schröder submitted Solution 14548441 to Problem 60803. Battery Charge Efficiency Calculation on 14 Feb 2025 |
Christian Schröder submitted Solution 14548440 to Problem 60802. Battery Voltage Drop Estimation on 14 Feb 2025 |
Christian Schröder submitted Solution 14548438 to Problem 60801. Battery Discharge Time Estimation on 14 Feb 2025 |
Christian Schröder submitted Solution 14548437 to Problem 60800. State of Charge (SoC) Estimation for a Battery on 14 Feb 2025 |
Christian Schröder submitted Solution 14548436 to Problem 60798. Battery Life Estimation for a Device on 14 Feb 2025 |
Christian Schröder submitted Solution 14548435 to Problem 60797. Calculate Charge Using Capacitance and Voltage on 14 Feb 2025 |
Christian Schröder submitted Solution 14548433 to Problem 60796. Energy Stored in a Capacitor on 14 Feb 2025 |
Christian Schröder submitted Solution 14548432 to Problem 60795. Ohm’s Law - Calculate Resistance on 14 Feb 2025 |
Christian Schröder submitted Solution 14548431 to Problem 60794. Simple Electrical Power Calculation on 14 Feb 2025 |
Christian Schröder submitted Solution 14548428 to Problem 60793. Calculate Current in a Series Circuit Using KVL on 14 Feb 2025 |
Christian Schröder submitted Solution 14547014 to Problem 60792. Calculating the Total Resistance in a Series Circuit on 13 Feb 2025 |
Christian Schröder submitted Solution 14541425 to Problem 60791. Sum of Even Fibonacci Numbers on 10 Feb 2025 |
Christian Schröder submitted Solution 14539988 to Problem 45363. Exponentiation on 9 Feb 2025 |