Skip to content

Commit 5a59d1e

Browse files
committed
changes made
1 parent c0fa140 commit 5a59d1e

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

Dynamic-Programming/KadaneAlgo.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,4 @@ function kadaneAlgo (array) {
2323
return maxSum
2424
// This function returns largest sum contiguous sum in a array
2525
}
26-
function main () {
27-
// input array
28-
const myArray = [1, 2, 3, 4, -6]
29-
// calling the function
30-
const result = kadaneAlgo(myArray)
31-
// result is the variable for storing the ourput of kadaneAlgo function
32-
console.log(result)
33-
}
34-
main()
35-
module.exports = { kadaneAlgo }
26+
export { kadaneAlgo }
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const fc = require('../kadaneAlgo')
2-
test('test1', () => {
1+
import { kadaneAlgo } from '../KadaneAlgo'
2+
test('it is being checked that 15 is the answer to the corresponding array input', () => {
33
expect(fc.kadaneAlgo([1, 2, 3, 4, 5])).toBe(15)
44
})
55

6-
test('test2', () => {
6+
test('it is being checked that 5 is the answer to the corresponding array input', () => {
77
expect(fc.kadaneAlgo([-1, -2, -3, -4, 5])).toBe(5)
88
})

0 commit comments

Comments
 (0)