• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
cruisediary Avatar
Name:Cruz
Clan:@hyperconnect
Member Since:Jan 2019
Last Seen:Sep 2024
Profiles:
Following:8
Followers:6
Allies:6
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (9)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • MojtabaHs
    • commented on "Extra Perfect Numbers (Special Numbers Series #7)" swift solution
    • 2 years ago

    This wil crash on passing 0

  • Custom User Avatar
    • CreoPride
    • commented on "Convert boolean values to strings 'Yes' or 'No'." swift solution
    • 3 years ago

    Functions With an Implicit Return
    search here - https://docs.swift.org/swift-book/LanguageGuide/Functions.html

  • Custom User Avatar
    • non432
    • commented on "Convert boolean values to strings 'Yes' or 'No'." swift solution
    • 3 years ago

    Where "return"? How it work?

  • Custom User Avatar
    • user6092675
    • commented on "Convert boolean values to strings 'Yes' or 'No'." swift solution
    • 3 years ago

    Thank you so much brother

  • Custom User Avatar
    • pastre
    • commented on "Convert boolean values to strings 'Yes' or 'No'." swift solution
    • 3 years ago

    Sure thing! This is the Ternary Operator, it's basically a single line if condition. The question mark asks whatever is on it's left if it's true or false. It then tells the colon to pick whatever is to it's left if the condition is true, or to it's right if the condition is false

    You should take a look at the official Swift documentation https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html. You can search for Ternary and you'll find whatever you're looking for

  • Custom User Avatar
    • user6092675
    • commented on "Convert boolean values to strings 'Yes' or 'No'." swift solution
    • 3 years ago

    hey could someone explain this code to me please

  • Custom User Avatar
    • farhanaditya
    • commented on "2 numbers, 1 solution " python solution
    • 4 years ago

    nice, and here I am hardcoded the whole thing xD

  • Custom User Avatar
    • n35k4
    • commented on "Convert boolean values to strings 'Yes' or 'No'." swift solution
    • 4 years ago

    Lovely <3 gg wp

  • Custom User Avatar
    • cruisediary
    • commented on "Follow that Spy" kata
    • 6 years ago

    For Swift

    let longRoutes = [["San Policarpo", "Oras"], ["Balangiga", "Lawaan"], ["Borongan", "Maydolong"], ["Jipapad", "Maslog"], ["Balangkayan", "Llorente"], ["Mercedes", "Guiuan"], ["Taft", "Sulat"], ["Sulat", "San Julian"], ["Arteche", "San Policarpo"], ["Oras", "Dolores"], ["Dolores", "Can-avid"], ["Can-avid", "Taft"], ["San Julian", "Borongan"], ["Maydolong", "Balangkayan"], ["Llorente", "Hernani"], ["Hernani", "General MacArthur"], ["General MacArthur", "Giporlos"], ["Giporlos", "Balangiga"], ["Lawaan", "Salcedo"], ["Salcedo", "Mercedes"], ["Maslog", "Arteche"]]

    XCTAssertEqual(findRoutes(routes: longRoutes), "Jipapad, Maslog, Arteche, San Policarpo, Oras, Dolores, Can-avid, Taft, Sulat, San Julian, Borongan, Maydolong, Balangkayan, Llorente, Hernani, General MacArthur, Giporlos, Balangiga, Lawaan, Salcedo, Mercedes, Guiuan")

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...