Print All N-Digit Patterns Formed by Mobile Keypad in C++

sudhir sharma
Updated on 22-Jan-2020 10:49:06

231 Views

In this problem, we are given a number n and we have to print all N digit patterns formed by pressing the mobile keypad button. While pressing the buttons, we can press only nearby buttons of the current button i.e. only keys left, right, up, down can be pressed.Let’s see how the old keypad looks like −12ABC3DEF4GHI5JKL6MNO7PQRS8TUV9WXYZ*0#Let’s take an example to understand the problemInput: n=2 Output: 12 14 21 23 25 32 36 41 45 47 52 54 56 58 63 65 69 74 78 85 87 89 80 96 98To solve this problem, we will use a depth-first search ... Read More

Print All N-Digit Numbers Whose Sum of Digits Equals Given Sum in C++

sudhir sharma
Updated on 22-Jan-2020 10:43:04

501 Views

In this problem, we are given two numbers n and sum. We have to print all n digit numbers whose sum is equal to the sum. In this problem, numbers with leading 0’s are not considered.Let’s take an example to understand the problem, Input: n = 2 , sum = 5 Output: 14 23 32 41 50 Explanation: The sum of digits of the number in all numbers in 5.To solve this problem, we will have to find all the n-digit numbers with sum with the given sum value. For this, we will fix a digit place with all values ... Read More

Print N-Digit Numbers with Absolute Difference of 1 in C++

sudhir sharma
Updated on 22-Jan-2020 10:40:04

265 Views

In this problem, we are given an integer n, and we have to print all n-digit numbers such that the absolute difference between the sum of digit of the number at even and odd places is 1. While creating the numbers leading 0’s are not considered.The absolute difference is the difference between both numbers whose value is an absolute value (positive value).Let’s take an example to understand the problem −Input: n = 2 Output: 10 12 21 23 32 34 43 45 54 56 65 67 76 78 87 89 98 Explaination : taking an of the numbers from the ... Read More

Print All N-Digit Strictly Increasing Numbers in C++

sudhir sharma
Updated on 22-Jan-2020 10:36:09

415 Views

In this problem, we are given a number N and we have to print all n-digit numbers whose digits are strickly increasing from MSB to LSB i.e. the number at LSB (left) should be smaller than the number at right.Let’s take an example to understand the problem −Input − n = 2Output −01 02 03 04 05 06 07 08 09 12 13 14 15 16 17 18 19 23 24 25 26 27 28 29 34 35 36 37 38 39 45 46 47 48 49 56 57 58 59 67 68 69 78 79 89.Explanation − as you ... Read More

Get All Processes on Local Computer Using Get-Process Command in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:35:52

6K+ Views

To get the threads of the running processes in the server using PowerShell you need to use Get-Process command. When you run this command default fields (ProcessName, Id, SI, CPU(s), WS(K), PM(K), NPM(K), Handles) will be displayed as a table.CommandGet-processOutputHandles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName -------  ------    -----      -----     ------     --  -- -----------     502      27     9796      19340       1.72   6320   1 AcroRd32     640      52   112028     ... Read More

Use of Get-Process Command in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:34:31

729 Views

Get-Process is a PowerShell cmdlet which used to get all the instances of the running background processes in the windows terminal. Whichever processes are displayed in the Task Manager Processes tab, all their threads can be displayed in the PowerShell console through Get-Process command.

Start Dependent Services in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:33:58

844 Views

To start dependent service in PowerShell, it is unlike the stopping the dependent services with –Force parameter because there is no –Force parameter is available.You need to first get the dependent services and then start them.Get-Service -Name Winmgmt -DependentServices | Start-Service -Verbose

Start Multiple Windows Services Using PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:33:25

3K+ Views

To start multiple services with PowerShell, we need to use comma (,) between services.For example,Start-Service -Name Spooler,AdobeARMservice -VerboseGet-Service -Name Spooler,AdobeARMservice | Start-Service -VerboseTo start the services with display name,Start-Service -Name “Print Spooler”, “Work Folder” -Verbose Get-Service -Name “Print Spooler”, “Work Folder” | Start-Service -Verbose

Print All Nodes at Distance K from a Given Node in C++

sudhir sharma
Updated on 22-Jan-2020 10:32:32

508 Views

In this problem, we are given a binary tree, a target node and an integer K. We have to print all the nodes of the tree that are at a distance K from the target node.Binary Tree is a special tree whose each node has at max two nodes (one/two/none).Let’s take an example to understand the problemK = 2Target node: 9Output −5 1 3.Explanation −The distance can be taken for node a higher, lower or at the same level. So, we will return nodes accordingly.To solve this problem we have to understand what are the types of nodes that are ... Read More

Start Windows Service with Display Name in PowerShell

Chirag Nagrekar
Updated on 22-Jan-2020 10:32:28

872 Views

To stop the service using display name, use the parameter –DisplayName.For Example,PS C:\> Start-Service -DisplayName "Print Spooler" -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".You can also start the service with display name using,PS C:\> Get-Service -DisplayName "Print Spooler" | Start-Service -Verbose

Advertisements