• Skip to primary navigation
  • Skip to content
  • Skip to footer
Xuanken's Space Xuanken's Space
  • About
  • Blog
  • Coding Exercises
  • Projects
    1. Home
    2. /
    3. Exercises
    4. /
    5. Narcissistic Number
    Xuanken Tay

    Xuanken Tay

    Software engineer who likes statistics, machine learning, DevOps and the cloud

    • Sydney, AU
    • GitHub
    • LinkedIn
    • Email

    Narcissistic Number

    January 14, 2022 less than 1 minute read

    Given an integer n, return whether it is equal to the sum of its own digits raised to the power of the number of digits.

    https://binarysearch.com/problems/Narcissistic-Number

    Examples

    Example 1

    Input

    • n = 153

    Output

    • answer = True

    Explanation

    153 = 1 ** 3 + 5 ** 3 + 3 ** 3

    Solution

    Categories: exercises

    Updated: January 14, 2022

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    Leave a comment

    Read more

    Hashicorp Certified: Vault Associate 002

    August 11, 2024 5 minute read

    How to prepare for the Vault Associate 002 exam.

    Helm: Migrate Releases from Helm 2 to Helm 3

    August 8, 2024 4 minute read

    How to migrate Helm 2 releases to Helm 3

    Kubernetes: Deployments

    May 11, 2024 2 minute read

    Ensuring reliable and up-to-date application deployment

    Anagram Substrings

    October 13, 2022 less than 1 minute read

    Given two strings s0 and s1, return the number of substrings where s1 contains any anagram of s0.

    • Follow:
    • GitHub
    • LinkedIn
    • Feed
    © 2024 Xuanken Tay. Powered by Jekyll & Minimal Mistakes.