• 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
pastre Avatar
Name:Bruno Pastre
Clan:Academy PUCPR
Member Since:Oct 2020
Last Seen:Apr 2024
Profiles:
Following:47
Followers:51
Allies:47
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (106)
  • Replies
  • Authored
  • Needs Resolution
  • 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
    • hobovsky
    • commented on ""Detect Pangram" Swift Translation"
    • 3 years ago

    Random tests almost never generate pangrams.
    Almost all tests can be passed with return false as a solution.

  • Custom User Avatar
    • pastre
    • commented on ""Detect Pangram" Swift Translation"
    • 3 years ago

    Implemented it

  • Custom User Avatar
    • pastre
    • commented on ""Detect Pangram" Swift Translation"
    • 3 years ago

    Oh, that's a great use of lazy! Thanks for the suggestion, will apply it to the solution :)

  • Custom User Avatar
    • akar-0
    • commented on ""Detect Pangram" Swift Translation"
    • 3 years ago

    No random tests.

  • Custom User Avatar
    • akar-0
    • resolved a suggestion on "Convert a Number to a String!" kata
    • 3 years ago

    Approved

  • 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
    • mgalik
    • commented on ""Detect Pangram" Swift Translation"
    • 3 years ago

    Great solution. However, you can still be more expressive than this in Swift. Like:
    !"abcdefghijklmnopqrstuvwxyz".lazy.map(string.lowercased().contains).contains(false)
    And it should be a bit faster, because you don't need to iterate over the whole input, just all the letters in the alphabet. And thanks to lazy, it should stop the first time it gets false.

  • 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
    • hobovsky
    • resolved a suggestion on "Find the odd int" kata
    • 4 years ago

    Approved

  • Custom User Avatar
    • StefanICT
    • commented on "Find the unique number" kata
    • 4 years ago

    Maybe change the function to func findUniq<N: Numeric>(_ arr: [N]) -> N {

  • Custom User Avatar
    • pastre
    • commented on "Insane Coloured Triangles" kata
    • 4 years ago

    Yep, this is mostly a math challenge

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...