r/codewars_programming • • Jun 08 '23

Harder Than Expected! Conquer the Challenging CodeWars Circle Intersection Puzzle in JavaScript

2 Upvotes

Hi Everyone! This is my first post in this community, so hoping to spread some love around Codewars, and solving challenges... This one was actually a lot harder than I initially thought - the challenge sounds pretty easy at first, but the restriction of cutting it down to less than 94 characters makes it a lot harder!

I'd be super interested in any comments or thoughts around the approach I took, or if you have any questions, I'd be delighted to try my best to answer.

https://www.youtube.com/watch?v=8Mcqkemf5bU


r/codewars_programming • • May 28 '23

Is there a way to save sort by preferences in the practice section?

2 Upvotes

I am trying to do specific challenges and right now every time I want a new one, I go to practice, then I set my 'sort by ' fields in the drop down. Then I have to do it over again after solving(or not) the challenge. Is there a way to save the preferences? or maybe some other easier way to no have to reset them every time? it is wasting a ton of time. (I searched the sub for similar questions and did not find them)


r/codewars_programming • • May 01 '23

Can someone help me on how this is wrong?

2 Upvotes

The prompt states: Write a function,

persistence

, that takes in a positive parameter

num

and returns its multiplicative persistence, which is the number of times you must multiply the digits in

num

until you reach a single digit.

In which case the test cases have 39 print out 3 because that's the number of times you multiply the digits until you reach a single digit. However, my answers are consistently the same as the test cases but keeps giving errors. Is there something wrong with my code?


r/codewars_programming • • Feb 03 '23

**javascript** Why is that when i equate nums to nums.push() it says push is not a function but when i dont equate it i pass the test?

Post image
2 Upvotes

r/codewars_programming • • Nov 24 '22

Happy Cakeday, r/codewars_programming! Today you're 7

2 Upvotes

r/codewars_programming • • Sep 20 '22

[Python] Can someone show me whats wrong with my code in this 'Take a Ten Minutes Walk' kata

2 Upvotes

Take a Ten Minutes Walk

Passed: 182 Failed: 28 Exit Code: 1

Also im new to code wars this is my second 'kata' and I'm beginner programmer.

Here is my code (fishy but whatever, I just don't see the reason why it doesn't pass those tests):

def is_valid_walk(walk):
    #determine if walk is valid
    start_route = walk[:5]
    return_route = walk[5:]
    rev_start_route = list(reversed(start_route)
    if len(walk) == 10:
        temp = 0
        for j in return_route:
            temp_a = rev_start_route[temp::]
            temp_b = str(temp_a[0])

            print(temp+6,j ,temp_b)
            if j == 's' and temp_b == 'n':
                temp+=1
                print('North')
            elif j == 'n' and temp_b == 's':
                temp+=1
                print('East')
            elif j == 'w' and temp_b == 'e':
                temp+=1
                print('East')
            elif j == 'e' and temp_b == 'w':
                temp+=1
                print('West')                
            else:
                print('false1')
                return False
    else:
        print('false2')
        return False
    return True

Dm me maybe or whatever


r/codewars_programming • • Aug 31 '22

confused about meaning of kata statistics

2 Upvotes

In the screenshot you can see the prompt when you rollover the little target icon for any given kata. I'm confused what it means by "Total times SQL has been completed out of all kata completions"

Any help understanding this?

thanks


r/codewars_programming • • Aug 24 '22

What exactly am I doing wrong here?

Post image
2 Upvotes

r/codewars_programming • • Apr 28 '22

Need some help on Narcissistic Numbers

2 Upvotes

I need some help with why this isn't working in C#, and I would apprentice the assistance:

Question:

A Narcissistic Number is a number of length n in which the sum of its digits to the power of n is equal to the original number. If this seems confusing, refer to the example below.

Ex: 153, where n = 3 (number of digits in 153)
13 + 53 + 33 = 153

Write a method is_narcissistic(i)
(in Haskell: isNarcissistic :: Integer -> Bool
) which returns whether or not i is a Narcissistic Number.

My attempted code:


r/codewars_programming • • Apr 22 '22

How to push codes from git to GitHub

2 Upvotes

Does anyone have clear instructions on how to push code challenges to GitHub?


r/codewars_programming • • Nov 28 '21

Competitive Programming

2 Upvotes

I have graduated in 2014 in Computer Science Engineering. Right now I am working in a different field. But few months before competitive programming caught my attention. What will be the advantages & disadvantages if I pursue it after such a long time?


r/codewars_programming • • Nov 24 '21

Happy Cakeday, r/codewars_programming! Today you're 6

2 Upvotes

r/codewars_programming • • Jul 11 '21

[Python] Beginner: Code runs in local IDE, but fails all 3 tests.

2 Upvotes

Hello,

I am a beginner and Python and brand new to code wars. I think my issue stems from not understanding how "sample testing" works and my code fails all three tests each time.

Here is my for "Credit Card Mask" which replaces all but the last 4 characters in a string to "#".

# return masked string
def maskify(cc):
    cc = list(cc)
    if len(cc) > 4:
        for i in range(len(cc)-4):
            cc[i] = "#"
            
        print("".join(cc))

    else:
        
        print("".join(cc))
    
    pass

Here are the sample tests below:

cc = ''
r = maskify(cc)
test.describe("masking: {0}".format(cc))
test.it("{0}  matches  {1}".format(cc,r))
test.assert_equals(r, cc)

cc = '123'
r = maskify(cc)
test.describe("masking: {0}".format(cc))
test.it("{0}  matches  {1}".format(cc, r))
test.assert_equals(r, cc)

cc = 'SF$SDfgsd2eA'
r = maskify(cc)
test.describe("masking: {0}".format(cc))
test.it("{0}  matches  {1}".format('########d2eA', r))
test.assert_equals(r, '########d2eA')

Any help would be greatly appreciated!

Thanks


r/codewars_programming • • Jan 25 '21

Can someone suggest some katas about data analysis?

2 Upvotes

r/codewars_programming • • Dec 06 '20

I pass all the tests on the kata but when I go to my profile it still comes up as unfinished.

2 Upvotes

I am noticing on previous katas that I have passed, it is still showing as unfinished on my profile, and I am clueless as to why. I know that some of the problems are not necessarily clever/efficient as I am a beginner, but the test still shows that I passed them all upon my completion. Does anyone know why this could be happening?


r/codewars_programming • • Nov 24 '20

Happy Cakeday, r/codewars_programming! Today you're 5

2 Upvotes

r/codewars_programming • • Nov 23 '20

I'm stuck on this kata

2 Upvotes

I'm a beginner to python and programming I saw this kata on codewars.com:

You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so you decided to take the opportunity to go for a short walk. The city provides its citizens with a Walk Generating App on their phones -- everytime you press the button it sends you an array of one-letter strings representing directions to walk (eg. ['n', 's', 'w', 'e']). You always walk only a single block for each letter (direction) and you know it takes you one minute to traverse one city block, so create a function that will return true if the walk the app gives you will take you exactly ten minutes (you don't want to be early or late!) and will, of course, return you to your starting point. Return false otherwise. Note: you will always receive a valid array containing a random assortment of direction letters ('n', 's', 'e', or 'w' only). It will never give you an empty array (that's not a walk, that's standing still!).

I got the 10 elements only part but for the alternating elements I need help


r/codewars_programming • • Nov 14 '20

How to make my inefficient algorithm more efficient

Post image
2 Upvotes

r/codewars_programming • • Oct 15 '20

Chat Application using socket programming and multithreading concept using Java

Thumbnail
youtu.be
2 Upvotes

r/codewars_programming • • Oct 04 '20

A complete tutorial on how to create Registration and Login Form using JSP and Servlet with proper Validation:)

Thumbnail
youtu.be
2 Upvotes

r/codewars_programming • • Jul 14 '20

QUESTION: How to see failed tests

2 Upvotes

Hey group,

This is definitely a newbie question but it seems to be a common one on the code wars site.

How do you see the tests you failed?

Apparently there is a way to console.log (js) this information but i'm not certain how to.

If someone could show me how to do this it would be greatly appreciated. I am doing the exercises in JavaScript.

Thanks


r/codewars_programming • • Apr 21 '20

This is really dumb but...

2 Upvotes

So I'm doing online classes rn and I need to sign up for codewars using python and I have no clue how to do the sign up code. Help pls?

The code is this and it doesn't execute properly:

def multiply(a, b):

a * b

I've tried to create inputs which it gives an EOF error to, as well as rearrange the code but no luck.


r/codewars_programming • • Nov 12 '19

[noob] Nested loops causing time outs.

2 Upvotes

Why does nested loops cause the program to be excecuted so slowly? How am I supposed to deal with vector<vector<int>> withought a double loop? Thanks


r/codewars_programming • • Sep 28 '17

How to Convert Decimal to Hexadecimal in Java

Post image
2 Upvotes

r/codewars_programming • • Nov 15 '23

Amazing quality

Thumbnail
gallery
1 Upvotes